Data.Conduit.Attoparsec
Description
Turn an Attoparsec parser into a Sink.
This code was taken from attoparsec-enumerator and adapted for conduits.
- data ParseError
- = ParseError {
- errorContexts :: [String]
- errorMessage :: String
- | DivergentParser
- = ParseError {
- class AttoparsecInput a
- sinkParser :: (AttoparsecInput a, ResourceThrow m) => Parser a b -> Sink a m b
Documentation
data ParseError Source
The context and message from a Fail value.
Constructors
| ParseError | |
Fields
| |
| DivergentParser | |
Instances
class AttoparsecInput a Source
A class of types which may be consumed by an Attoparsec parser.
Instances
sinkParser :: (AttoparsecInput a, ResourceThrow 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 resourceThrow.