HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulehnix-store-nar-0.1.2.0Haskell2010

System.Nix.Nar.Streamer

Stream out a NAR file from a regular file

  • 2 types
  • 4 values
typetype NarSource (m :: Type -> Type) = (ByteString -> m ()) -> m ()
#

NarSource The source to provide nar to the handler `(ByteString -> m ())`. It is isomorphic to ByteString by Yoneda lemma if the result is meant to be m (). It is done in CPS style so IO can be chunks.

valuedumpPath
  1. :: MonadIO m
  2. => FilePath

    path for the file you want to dump to nar

  3. -> NarSource m

    the nar result in CPS style

#

dumpPath shorthand build a Source that turn file path to nar using the default narEffectsIO.

This implementation of Nar encoding takes an arbitrary yield function from any streaming library, and repeatedly calls it while traversing the filesystem object to Nar encode