list-t-attoparsec-0.4.1: An "attoparsec" adapter for "list-t"
ListT.Attoparsec
Synopsis
type Error = (Text, [Text]) Source #
A text message and a list of contexts, as per the failure in "attoparsec".
stream :: 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.
Error
EitherT
consume :: 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.