Copyright | Bryan O'Sullivan 2007-2015 |
---|---|
License | BSD3 |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Simple, efficient combinator parsing that can consume lazy Text
strings, loosely based on the Parsec library.
This is essentially the same code as in the Text
module, only with a parse
function that can consume a lazy
Text
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 Text
parameters, and return
strict Text
results. Behind the scenes, strict Text
values
are still used internally to store parser input and manipulate it
efficiently.
Documentation
The result of a parse.
Fail Text [String] String | The parse failed. The |
Done Text r | The parse succeeded. The |
module Data.Attoparsec.Text
Running parsers
parseTest :: Show a => Parser a -> Text -> IO () Source
Run a parser and print its result to standard output.