You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.0 KiB
33 lines
1.0 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
<pkgmetadata>
|
|
<maintainer type="project">
|
|
<email>haskell@gentoo.org</email>
|
|
<name>Gentoo Haskell</name>
|
|
</maintainer>
|
|
<longdescription>
|
|
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
|
|
</longdescription>
|
|
</pkgmetadata>
|