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

Safe HaskellSafe-Infered

Data.Conduit.Attoparsec

Description

Turn an Attoparsec parser into a Sink.

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

Synopsis

Documentation

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.