The attoparsec-enumerator package
This library allows an Attoparsec parser to receive input incrementally from an enumerator. This could be used for parsing large files, or implementing binary network protocols.
(-# LANGUAGE OverloadedStrings #-)
import Control.Applicative
import Data.Attoparsec
import Data.Attoparsec.Enumerator
import Data.Enumerator
import Data.Enumerator.Binary (enumHandle)
import Data.Enumerator.List
import System.IO
parser = string "foo" <|> string "bar"
main = do
xy <- run_ (enumHandle 1 stdin $$ do
x <- iterParser parser
y <- iterParser parser
return (x, y))
print xy
Properties
| Versions | 0.1, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.2, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.0.4, 0.2.0.5, 0.3, 0.3.1 |
|---|---|
| Dependencies | attoparsec (0.10.*), base (≥4.0 & <5.0), bytestring (≥0.9), enumerator (0.4.*), text |
| License | MIT |
| Author | John Millikin <jmillikin@gmail.com> |
| Maintainer | John Millikin <jmillikin@gmail.com> |
| Stability | experimental |
| Category | Text, Parsing, Enumerator |
| Home page | https://john-millikin.com/software/attoparsec-enumerator/ |
| Bug tracker | mailto:jmillikin@gmail.com |
| Source repository | bzr branch https://john-millikin.com/branches/attoparsec-enumerator/0.3/ |
| Upload date | Wed Aug 15 02:15:22 UTC 2012 |
| Uploaded by | JohnMillikin |
| Built on | ghc-7.4 |
| Distributions | Fedora: 0.3.1, NixOS: 0.3.1, Debian: 0.3.1, FreeBSD: 0.3.1 |
Modules
- Data
- Attoparsec
Downloads
- attoparsec-enumerator-0.3.1.tar.gz (Cabal source package)
- package description (included in the package)