Copyright | Bryan O'Sullivan 2007-2015 |
---|---|
License | BSD3 |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Simple, efficient combinator parsing that can consume lazy
ByteString
strings, loosely based on the Parsec library.
This is essentially the same code as in the Attoparsec
module, only with a parse
function that can consume a lazy
ByteString
incrementally, and a Result
type that does not allow
more input to be fed in. Think of this as suitable for use with a
lazily read file, e.g. via readFile
or hGetContents
.
Note: The various parser functions and combinators such as
string
still expect strict ByteString
parameters, and
return strict ByteString
results. Behind the scenes, strict
ByteString
values are still used internally to store parser
input and manipulate it efficiently.
- parse :: Monad m => Parser a -> ByteString m x -> m (Either a ([String], String), ByteString m x)
- parsed :: Monad m => Parser a -> ByteString m r -> Stream (Of a) m (Either (([String], String), ByteString m r) r)
- atto :: Monad m => Parser a -> StateT (ByteString m x) m (Either a ([String], String))
- atto_ :: Monad m => Parser a -> ExceptT ([String], String) (StateT (ByteString m x) m) a
- module Data.Attoparsec.ByteString
Documentation
parse :: Monad m => Parser a -> ByteString m x -> m (Either a ([String], String), ByteString m x) Source
The result of a parse.
:: Monad m | |
=> Parser a | Attoparsec parser |
-> ByteString m r | Raw input |
-> Stream (Of a) m (Either (([String], String), ByteString m r) r) |
atto :: Monad m => Parser a -> StateT (ByteString m x) m (Either a ([String], String)) Source
Run a parser and return its result.
module Data.Attoparsec.ByteString