MIT licensed and maintained by John Millikin
This version can be pinned in stack with:attoparsec-enumerator-0.3.4@sha256:d8c847ce451fec7cada2e39a3ef405321eb98de0921b4139c34a271b5ace1ff7,1635

Module documentation for 0.3.4

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