Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stream out a NAR file from a regular file
Synopsis
- type NarSource m = (ByteString -> m ()) -> m ()
- dumpString :: forall m. MonadIO m => ByteString -> NarSource m
- dumpPath :: forall m. MonadIO m => FilePath -> NarSource m
- streamNarIO :: forall m. MonadIO m => NarEffects IO -> FilePath -> NarSource m
- data IsExecutable
Documentation
type NarSource m = (ByteString -> m ()) -> m () Source #
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.
:: forall m. MonadIO m | |
=> ByteString | the string you want to dump |
-> NarSource m | The nar result in CPS style |
dumpString
dump a string to nar in CPS style. The function takes in a ByteString
,
and build a `NarSource m`.
:: forall m. MonadIO m | |
=> FilePath | path for the file you want to dump to nar |
-> NarSource m | the nar result in CPS style |
dumpPath shorthand build a Source that turn file path to nar using the default narEffectsIO.
streamNarIO :: forall m. MonadIO m => NarEffects IO -> FilePath -> NarSource m Source #
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
data IsExecutable Source #
Instances
Eq IsExecutable Source # | |
Defined in System.Nix.Internal.Nar.Streamer (==) :: IsExecutable -> IsExecutable -> Bool # (/=) :: IsExecutable -> IsExecutable -> Bool # | |
Show IsExecutable Source # | |
Defined in System.Nix.Internal.Nar.Streamer showsPrec :: Int -> IsExecutable -> ShowS # show :: IsExecutable -> String # showList :: [IsExecutable] -> ShowS # |