attoparsec-conduit-0.3.0: Turn attoparsec parsers into sinks.

Safe HaskellSafe-Infered



Turn an Attoparsec parser into a Sink.

This code was taken from attoparsec-enumerator and adapted for conduits.



data ParseError Source

The context and message from a Fail value.

class AttoparsecInput a Source

A class of types which may be consumed by an Attoparsec parser.

sinkParser :: (AttoparsecInput a, MonadThrow m) => Parser a b -> Sink a m bSource

Convert an Attoparsec Parser into a Sink. The parser will be streamed bytes until it returns Done or Fail.

If parsing fails, a ParseError will be thrown with monadThrow.