hnix-store-nar-0.1.1.0: NAR file format
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Nix.Nar.Parser

Description

A streaming parser for the NAR format

Synopsis

Documentation

runParser Source #

Arguments

:: forall m a. (MonadIO m, MonadBaseControl IO m) 
=> NarEffects m

Provide the effects set, usually narEffectsIO

-> NarParser m a

A parser to run, such as parseNar

-> Handle

A handle the stream containg the NAR. It should already be open and in ReadMode

-> FilePath

The root file system object to be created by the NAR

-> m (Either String a) 

Run a NarParser over a byte stream This is suitable for testing the top-level NAR parser, or any of the smaller utilities parsers, if you have bytes appropriate for them

runParserWithOptions Source #

Arguments

:: forall m a. (MonadIO m, MonadBaseControl IO m) 
=> NarOptions 
-> NarEffects m

Provide the effects set, usually narEffectsIO

-> NarParser m a

A parser to run, such as parseNar

-> Handle

A handle the stream containg the NAR. It should already be open and in ReadMode

-> FilePath

The root file system object to be created by the NAR

-> m (Either String a) 

parseNar :: (MonadIO m, MonadFail m) => NarParser m () Source #

Parse a NAR byte string, producing (). Parsing a NAR is mostly used for its side-effect: producing the file system objects packed in the NAR. That's why we pure ()

testParser :: m ~ IO => NarParser m a -> ByteString -> m (Either String a) Source #