list-t-attoparsec-0.3.1.1: An "attoparsec" adapter for "list-t"

Safe HaskellNone
LanguageHaskell2010

ListT.Attoparsec

Synopsis

Documentation

data Error Source

A text message and a list of contexts, as per the failure in "attoparsec".

Constructors

Error !String ![String] 

textParser :: Monad m => Parser a -> ListT m Text -> ListT (EitherT Error m) a Source

Given a text parser, produces a transformation of a stream of text chunks into a stream of parsed results. In case of a parsing failure it raises an Error in the EitherT monad over the base.

consumeOne :: Monad m => Parser a -> ListT m Text -> m (Either Error (a, ListT m Text)) Source

Consume only as much input as needed to run the provided parser once. Results in either a failure or the parsed result and the leftover stream.