Safe Haskell | None |
---|---|
Language | Haskell2010 |
A streaming parser for the NAR format
Synopsis
- runParser :: forall m a. (MonadIO m, MonadBaseControl IO m) => NarEffects m -> NarParser m a -> Handle -> FilePath -> m (Either String a)
- parseNar :: (MonadIO m, MonadFail m) => NarParser m ()
- testParser :: m ~ IO => NarParser m a -> ByteString -> m (Either String a)
- testParser' :: m ~ IO => FilePath -> IO (Either String ())
Documentation
:: forall m a. (MonadIO m, MonadBaseControl IO m) | |
=> NarEffects m | Provide the effects set, usually |
-> NarParser m a | A parser to run, such as |
-> Handle | A handle the stream containg the NAR. It should already be
open and in |
-> 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
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 #