attoparsec-enumerator-0.3.4: Pass input from an enumerator to an Attoparsec parser.

Copyright2010 John Millikin
LicenseMIT
Maintainerjmillikin@gmail.com
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.Attoparsec.Enumerator

Description

 

Synopsis

Documentation

class AttoparsecInput a #

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

Since: 0.3

Minimal complete definition

parseA, feedA, empty, isNull, notEmpty

Instances

AttoparsecInput ByteString # 

Methods

parseA :: Parser ByteString b -> ByteString -> IResult ByteString b

feedA :: IResult ByteString b -> ByteString -> IResult ByteString b

empty :: ByteString

isNull :: ByteString -> Bool

notEmpty :: [ByteString] -> [ByteString]

AttoparsecInput Text # 

Methods

parseA :: Parser Text b -> Text -> IResult Text b

feedA :: IResult Text b -> Text -> IResult Text b

empty :: Text

isNull :: Text -> Bool

notEmpty :: [Text] -> [Text]

iterParser :: (AttoparsecInput a, Monad m) => Parser a b -> Iteratee a m b #

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

If parsing fails, a ParseError will be thrown with throwError. Use catchError to catch it.