summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-haskell/attoparsec-enumerator/metadata.xml')
-rw-r--r--dev-haskell/attoparsec-enumerator/metadata.xml29
1 files changed, 29 insertions, 0 deletions
diff --git a/dev-haskell/attoparsec-enumerator/metadata.xml b/dev-haskell/attoparsec-enumerator/metadata.xml
new file mode 100644
index 000000000000..8459a59d4c56
--- /dev/null
+++ b/dev-haskell/attoparsec-enumerator/metadata.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>haskell</herd>
+ <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.
+
+ &gt; (-# LANGUAGE OverloadedStrings #-)
+ &gt;
+ &gt; import Control.Applicative
+ &gt; import Data.Attoparsec
+ &gt; import Data.Attoparsec.Enumerator
+ &gt; import Data.Enumerator
+ &gt; import Data.Enumerator.Binary (enumHandle)
+ &gt; import Data.Enumerator.List
+ &gt; import System.IO
+ &gt;
+ &gt; parser = string &quot;foo&quot; &lt;|&gt; string &quot;bar&quot;
+ &gt;
+ &gt; main = do
+ &gt; xy &lt;- run_ (enumHandle 1 stdin $$ do
+ &gt; x &lt;- iterParser parser
+ &gt; y &lt;- iterParser parser
+ &gt; return (x, y))
+ &gt; print xy
+ </longdescription>
+</pkgmetadata>