blob: 4f48a5c05d4ff1b2c9299c4d8d272c4ef24889a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?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>
|