Safe Haskell | None |
---|
This module provides low-level integration with Attoparsec and is likely to be modified in backwards-incompatible ways in the future.
Use the stable API exported by the Pipes.Attoparsec module instead.
- data ParsingError = ParsingError {
- peContexts :: [String]
- peMessage :: String
- class (Eq a, Monoid a) => ParserInput a
- parseWithDraw :: (Monad m, ParserInput a) => Parser a b -> StateT (Producer a m r) m (Either ParsingError (Int, b), Maybe a)
- parseWithRaw :: (Monad m, ParserInput a) => m a -> Parser a r -> m (Either ParsingError (Int, r), Maybe a)
Types
data ParsingError Source
A parsing error report, as provided by Attoparsec's Fail
.
ParsingError | |
|
class (Eq a, Monoid a) => ParserInput a Source
A class for valid Attoparsec input types: strict Text
and
strict ByteString
.
Parsing
:: (Monad m, ParserInput a) | |
=> Parser a b | Parser to run on the given input |
-> StateT (Producer a m r) m (Either ParsingError (Int, b), Maybe a) | Either a parser error or a pair of a result and the parsed input length, as well as an any leftovers. |
Run a parser drawing input from the underlying Producer
.
:: (Monad m, ParserInput a) | |
=> m a | An action that will be executed to provide the parser with more input
as needed. If the action returns |
-> Parser a r | Parser to run on the given input |
-> m (Either ParsingError (Int, r), Maybe a) | Either a parser error or a pair of a result and the parsed input length, as well as an any leftovers. |
Run a parser drawing input from the given monadic action as needed.