PE      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portablejmillikin@gmail.comIKIn cases where an enumerator acts as both a source and sink, the resulting  type is named an $. Enumeratees have two input types,   outer a  (aOut) and  inner a  (aIn). While /s consume data, enumerators generate it. Since   is an alias for m ( a m b), s can ) be considered step transformers of type   a m b -> m ( a m b). :s typically read from an external source (parser, handle, 2 random generator, etc). They feed chunks into an  until the % source runs out of data (triggering ) or the iteratee finishes  processing ( s a value). 7The primary data type for this library, which consumes  input from a  1 until it either generates a value or encounters E an error. Rather than requiring all input at once, an iteratee will  return - when it is capable of processing more data. #In general, iteratees begin in the  state. As each chunk is A passed to the continuation, the iteratee returns the next step:   for more data,  when it's finished, or  to  abort processing. The 8 encountered an error which prevents it from proceeding  further. The 4 cannot receive any more input, and has generated a K result. Included in this value is left-over input, which can be passed to  composed s. The : is capable of accepting more input. Note that more input " is not necessarily required; the  might be able to generate a " value immediately if it receives . A  ) is a sequence of chunks generated by an . ( [])8 is used to indicate that a stream is still active, but H currently has no available data. Iteratees should ignore empty chunks.     step =  (return step)! ! x extra =   ( x extra)CWARNING: due to the current encoding of iteratees in this library,  careless use of the !' primitive may violate the monad laws. A To prevent this, always make sure that an iteratee never yields ? extra data unless it has received at least one input element. >More strictly, iteratees may not yield data that they did not  receive as input. Don't use ! to  inject  elements  into the stream. " " k =   ( k)#ERun an iteratee until it finishes, and return either the final value 0 (if it succeeded) or the error (if it failed). $Like #8, except errors are converted to exceptions and thrown. ; Primarily useful for small scripts or other simple cases.  Since: 0.4.1 % % exc =   ( ( exc))&8Runs the iteratee, and calls an exception handler if an  is K returned. By handling errors within the enumerator library, and requiring ! all errors to be represented by , libraries with - varying error types can be easily composed.  Since: 0.1.1 'Equivalent to '(>>=)' for m ( a m b) ; allows s with ' different input types to be composed. ( '(==<<)' = flip '(>>==)') '($$)' = '(==<<)'EThis might be easier to read when passing a chain of iteratees to an  enumerator.  Since: 0.1.1 * '(>==>)' e1 e2 s = e1 s ' e2 Since: 0.1.1 + '(<==<)' = flip '(>==>)' Since: 0.1.1 ,Print chunks as they',re received from the enumerator, optionally  printing empty chunks. Print empty chunks -- n xs enumerates xs as a stream, passing n inputs per  chunk. ,Primarily useful for testing and debugging. .Compose a list of s using '(>>==)' // is used to  flatten   s into an  . 01Flatten an enumerator/*enumeratee pair into a single enumerator. 2 enum $= enee = 1 enum enee Wraps  an enumerator inner in an enumeratee wrapper. ( The resulting enumerator will generate wrapper s output type. HAs an example, consider an enumerator that yields line character counts > for a text file (e.g. for source code readability checking):  3 enumFileCounts :: FilePath -> Enumerator Int IO b  It could be written with either 1 or '($=)':   import Data.Text as T # import Data.Enumerator.List as EL # import Data.Enumerator.Text as ET  ? enumFileCounts path = joinE (enumFile path) (EL.map T.length) 8 enumFileCounts path = enumFile path $= EL.map T.length  Since: 0.4.9 3FFeeds outer input elements into the provided iteratee until it yields D an inner input, passes that to the inner iteratee, and then loops. 4Sends * to its iteratee. Most clients should use # or $  instead. 5A common pattern in % implementations is to check whether  the inner 0 has finished, and if so, to return its output.  6, passes its parameter a continuation if the  / can still consume input, or yields otherwise.  Since: 0.4.3 6 6 = 5 ( [])<Use this for enumeratees which do not have an input buffer. 7@Check whether a stream has reached EOF. Most clients should use  Data.Enumerator.List.head instead. 8GTry to run an IO computation. If it throws an exception, the exception " is caught and converted into an {t t Error}.  Since: 0.4.9 9A common pattern in % implementations is to check whether  the inner 0 has finished, and if so, to return its output.  9, passes its parameter a continuation if the  9 can still consume input; if not, it returns the iteratee's step. .The type signature here is a bit crazy, but it's actually very easy to  use. Take this code:  , repeat :: Monad m => a -> Enumerator a m b  repeat x = loop where / loop (Continue k) = k (Chunks [x]) >>== loop  loop step = returnI step (And rewrite it without the boilerplate:  , repeat :: Monad m => a -> Enumerator a m b @ repeat x = checkContinue0 $ \loop k -> k (Chunks [x] >>== loop  Since: 0.4.9 :Like 92, but allows each loop step to use a state value:  9 iterate :: Monad m => (a -> a) -> a -> Enumerator a m b J iterate f = checkContinue1 $ \loop a k -> k (Chunks [a]) >>== loop (f a)  Since: 0.4.9 ;Lift an + onto a monad transformer, re-wrapping the   s inner monadic values.  Since: 0.1.1 <Deprecated in 0.4.5: use " instead =+Peek at the next element in the stream, or  if the stream  has ended. >'Get the last element in the stream, or  if the stream  has ended. Consumes the entire stream. ?.Get how many elements remained in the stream. Consumes the entire stream. @Deprecated in 0.4.5: use Data.Enumerator.List.head instead ADeprecated in 0.4.5: use Data.Enumerator.List.drop instead BDeprecated in 0.4.5: use Data.Enumerator.List.dropWhile instead CDeprecated in 0.4.5: use Data.Enumerator.List.takeWhile instead DDeprecated in 0.4.5: use Data.Enumerator.List.takeWhile instead EDeprecated in 0.4.5: use Data.Enumerator.List.consume instead FDeprecated in 0.4.8: use Data.Enumerator.List.fold instead  Since: 0.4.5 GDeprecated in 0.4.8: use Data.Enumerator.List.fold instead  Since: 0.4.5 HDeprecated in 0.4.8: use Data.Enumerator.List.foldM instead  Since: 0.4.5 IDeprecated in 0.4.8: use Data.Enumerator.List.iterate instead  Since: 0.4.5 JDeprecated in 0.4.8: use Data.Enumerator.List.iterateM instead  Since: 0.4.5 KDeprecated in 0.4.8: use Data.Enumerator.List.repeat instead  Since: 0.4.5 LDeprecated in 0.4.8: use Data.Enumerator.List.repeatM instead  Since: 0.4.5 MDeprecated in 0.4.8: use Data.Enumerator.List.replicate instead  Since: 0.4.5 NDeprecated in 0.4.8: use Data.Enumerator.List.replicateM instead  Since: 0.4.5 ODeprecated in 0.4.8: use Data.Enumerator.List.generateM instead  Since: 0.4.5 PDeprecated in 0.4.8: use Data.Enumerator.List.map instead QDeprecated in 0.4.8: use Data.Enumerator.List.mapM instead  Since: 0.4.3 RDeprecated in 0.4.8: use Data.Enumerator.List.concatMap instead  Since: 0.4.3 SDeprecated in 0.4.8: use Data.Enumerator.List.concatMapM instead  Since: 0.4.5 TDeprecated in 0.4.8: use Data.Enumerator.List.filter instead  Since: 0.4.5 UDeprecated in 0.4.8: use Data.Enumerator.List.filterM instead  Since: 0.4.5 VDeprecated in 0.4.5: use Data.Enumerator.List.fold instead  Since: 0.1.1 WDeprecated in 0.4.5: use Data.Enumerator.List.fold instead  Since: 0.1.1 XDeprecated in 0.4.5: use Data.Enumerator.List.foldM instead  Since: 0.1.1  Since: 0.4.5  Since: 0.4.8  Since: 0.4.6  Since: 0.4.8 E  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXE  "!'()*+02#$%&./1349:5678,-;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXE  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXportablejmillikin@gmail.com CApplies a monadic predicate to the stream. The inner iteratee only 3 receives elements for which the predicate returns True.  Since: 0.4.8 DApplies a predicate to the stream. The inner iteratee only receives % elements for which the predicate is True.  Since: 0.4.8   f applies f% to each input element and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8  R f applies f% to each input element and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 Q f applies f% to each input element and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 P f applies f% to each input element and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 Like 5, except the computation may terminate the stream by  returning .  Since: 0.4.8 M n x enumerates a stream containing n copies of x.  Analogous to .  Since: 0.4.8  n m_x enumerates a stream of n elements, with each  element computed by m_x.  Since: 0.4.8 FEnumerates an infinite stream of element. Each element is computed by  the underlying monad.  Since: 0.4.8 3Enumerates an infinite stream of a single element.  Analogous to .  Since: 0.4.8  Similar to I,, except the iteration function is monadic.  Since: 0.4.8 I f x8 enumerates an infinite stream of repeated applications  of f to x.  Analogous to .  Since: 0.4.8 EConsume the entire input stream with a strict monadic left fold, one  element at a time.  Since: 0.4.8 EConsume the entire input stream with a strict left fold, one element  at a time.  Since: 0.4.8   =  (const True) Since: 0.4.5  p8 extracts input from the stream until the first element % which does not match the predicate.  Since: 0.4.5 B p7 ignores input from the stream until the first element % which does not match the predicate.  Since: 0.4.5  n ignores n! input elements from the stream.  Since: 0.4.5 )Get the next element from the stream, or  if the stream has  ended.  Since: 0.4.5 YEEnumerates a stream of elements by repeatedly applying a function to  some state.  Similar to I.  Since: 0.4.8 ZHEnumerates a stream of elements by repeatedly applying a computation to  some state.  Similar to .  Since: 0.4.8 [ Similar to P%, but with a stateful step function.  Since: 0.4.9 \ Similar to Q%, but with a stateful step function.  Since: 0.4.9 ]] n extracts the next n& elements from the stream, as a list.  Since: 0.4.5 ^^ n buffers input until at least n elements are available, or + throws an error if the stream ends early.  Since: 0.4.5 __ n reads at most n+ elements from the stream, and passes them J to its iteratee. If the iteratee finishes early, elements continue to be & consumed from the outer stream until n have been consumed.  Since: 0.4.5 `0Split on elements satisfying a given predicate.  Since: 0.4.8  YZ[\]^_` [\YZ ]^_` YZ[\]^_`portablejmillikin@gmail.com#aBConsume the entire input stream with a strict left fold, one byte  at a time.  Since: 0.4.8 bEConsume the entire input stream with a strict monadic left fold, one  byte at a time.  Since: 0.4.8 cBEnumerates a stream of bytes by repeatedly applying a function to  some state.  Similar to kI.  Since: 0.4.8 dEEnumerates a stream of bytes by repeatedly applying a computation to  some state.  Similar to l.  Since: 0.4.8 eeP f applies f" to each input byte and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 ffQ f applies f" to each input byte and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 ggR f applies f" to each input byte and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 hh f applies f" to each input byte and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 i Similar to eP%, but with a stateful step function.  Since: 0.4.9 j Similar to fQ%, but with a stateful step function.  Since: 0.4.9 kkI f x8 enumerates an infinite stream of repeated applications  of f to x.  Analogous to .  Since: 0.4.8 l Similar to kI,, except the iteration function is monadic.  Since: 0.4.8 m0Enumerates an infinite stream of a single byte.  Analogous to .  Since: 0.4.8 nDEnumerates an infinite stream of byte. Each byte is computed by the  underlying monad.  Since: 0.4.8 ooM n x enumerates a stream containing n copies of x.  Since: 0.4.8 pp n m_x enumerates a stream of n bytes, with each byte  computed by m_x.  Since: 0.4.8 qLike n5, except the computation may terminate the stream by  returning .  Since: 0.4.8 rDApplies a predicate to the stream. The inner iteratee only receives ' characters for which the predicate is True.  Since: 0.4.8 sCApplies a monadic predicate to the stream. The inner iteratee only 0 receives bytes for which the predicate returns True.  Since: 0.4.8 tt n extracts the next n" bytes from the stream, as a lazy  ByteString.  Since: 0.4.5 uu p; extracts input from the stream until the first byte which  does not match the predicate.  Since: 0.4.5 v v = u (const True) Since: 0.4.5 w&Get the next byte from the stream, or  if the stream has  ended.  Since: 0.4.5 xx n ignores n! bytes of input from the stream.  Since: 0.4.5 yyB p4 ignores input from the stream until the first byte % which does not match the predicate.  Since: 0.4.5 zz n buffers input until at least n bytes are available, or + throws an error if the stream ends early.  Since: 0.4.5 {{ n reads at most n( bytes from the stream, and passes them G to its iteratee. If the iteratee finishes early, bytes continue to be & consumed from the outer stream until n have been consumed.  Since: 0.4.5 |-Split on bytes satisfying a given predicate.  Since: 0.4.8 }ERead bytes (in chunks of the given buffer size) from the handle, and  stream them to an ). If an exception occurs during file IO,  enumeration will stop and ' will be returned. Exceptions from the  iteratee are not caught. EThis enumerator blocks until at least one byte is available from the B handle, and might read less than the maximum buffer size in some  cases. 5The handle should be opened with no encoding, and in  or  .  Since: 0.4.5  Buffer size ~ERead bytes (in chunks of the given buffer size) from the handle, and  stream them to an ). If an exception occurs during file IO,  enumeration will stop and ' will be returned. Exceptions from the  iteratee are not caught. EThis enumerator blocks until at least one byte is available from the B handle, and might read less than the maximum buffer size in some  cases. 5The handle should be opened with no encoding, and in  or  . DIf an offset is specified, the handle will be seeked to that offset B before reading. If the handle cannot be seeked, an error will be  thrown. CIf a maximum count is specified, the number of bytes read will not  exceed that count.  Since: 0.4.8  Buffer size Offset Maximum count ;Opens a file path in binary mode, and passes the handle to  }5. The file will be closed when enumeration finishes.  Since: 0.4.5 ;Opens a file path in binary mode, and passes the handle to  ~5. The file will be closed when enumeration finishes.  Since: 0.4.8 Offset Maximum count ERead bytes from a stream and write them to a handle. If an exception 2 occurs during file IO, enumeration will stop and  will be  returned. 5The handle should be opened with no encoding, and in  or  .  Since: 0.4.5 !abcdefghijklmnopqrstuvwxyz{|}~!}~abefghijklmnopqcdrstuvwxyz{|!abcdefghijklmnopqrstuvwxyz{|}~portablejmillikin@gmail.com7GConsume the entire input stream with a strict left fold, one character  at a time.  Since: 0.4.8 EConsume the entire input stream with a strict monadic left fold, one  character at a time.  Since: 0.4.8 GEnumerates a stream of characters by repeatedly applying a function to  some state.  Similar to I.  Since: 0.4.8 GEnumerates a stream of characters by repeatedly applying a computation  to some state.  Similar to .  Since: 0.4.8 P f applies f' to each input character and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 Q f applies f' to each input character and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8 R f applies f' to each input character and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8  f applies f' to each input character and feeds the * resulting outputs to the inner iteratee.  Since: 0.4.8  Similar to P%, but with a stateful step function.  Since: 0.4.9  Similar to Q%, but with a stateful step function.  Since: 0.4.9 I f x8 enumerates an infinite stream of repeated applications  of f to x.  Analogous to .  Since: 0.4.8  Similar to I,, except the iteration function is monadic.  Since: 0.4.8 5Enumerates an infinite stream of a single character.  Analogous to .  Since: 0.4.8 HEnumerates an infinite stream of characters. Each character is computed  by the underlying monad.  Since: 0.4.8 M n x enumerates a stream containing n copies of x.  Since: 0.4.8  n m_x enumerates a stream of n characters, with each  character computed by m_x.  Since: 0.4.8 Like 5, except the computation may terminate the stream by  returning .  Since: 0.4.8 DApplies a predicate to the stream. The inner iteratee only receives ' characters for which the predicate is True.  Since: 0.4.8 CApplies a monadic predicate to the stream. The inner iteratee only 5 receives characters for which the predicate returns True.  Since: 0.4.8  n extracts the next n' characters from the stream, as a lazy  Text.  Since: 0.4.5  p: extracts input from the stream until the first character % which does not match the predicate.  Since: 0.4.5   =  (const True) Since: 0.4.5 +Get the next character from the stream, or  if the stream has  ended.  Since: 0.4.5  n ignores n& characters of input from the stream.  Since: 0.4.5 B p9 ignores input from the stream until the first character % which does not match the predicate.  Since: 0.4.5  n buffers input until at least n characters are available, . or throws an error if the stream ends early.  Since: 0.4.5  n reads at most n( characters from the stream, and passes K them to its iteratee. If the iteratee finishes early, characters continue , to be consumed from the outer stream until n have been consumed.  Since: 0.4.5 2Split on characters satisfying a given predicate.  Since: 0.4.8   =  (== '\n') Since: 0.4.8 :Read lines of text from the handle, and stream them to an . B If an exception occurs during file IO, enumeration will stop and  @ will be returned. Exceptions from the iteratee are not caught. CThe handle should be opened with an appropriate text encoding, and  in  or .  Since: 0.2 9Opens a file path in text mode, and passes the handle to . " The file will be closed when the  finishes.  Since: 0.2 BRead text from a stream and write it to a handle. If an exception 2 occurs during file IO, enumeration will stop and  will be  returned. CThe handle should be opened with an appropriate text encoding, and  in  or .  Since: 0.2 CConvert text into bytes, using the provided codec. If the codec is J not capable of representing an input character, an error will be thrown.  Since: 0.2 CConvert bytes into text, using the provided codec. If the codec is J not capable of decoding an input byte sequence, an error will be thrown.  Since: 0.2 ***portablejmillikin@gmail.comDeprecated in 0.4.5: use } instead Deprecated in 0.4.5: use  instead Deprecated in 0.4.5: use  instead        !"#$%&'()*+,-./0123456789:;<=>?@ABCDE#"!FGHIJKLMNOPQRSTMNOPQ #"!RSTUVWXYZMNOPQ #"!RST[UWY\]^_`abcdUWYefghijklmklnklnkopqrstkukvkwkukukuku!kuQkxykxz{kx|}Z~}enumerator-0.4.9Data.EnumeratorData.Enumerator.ListData.Enumerator.BinaryData.Enumerator.TextData.Enumerator.IOData.Enumerator.Util Enumeratee EnumeratorIteratee runIterateeStepErrorYieldContinueStreamfilterMfilter concatMapM concatMapmapMmap generateM replicate replicateMrepeatMrepeatiterateMiteratefoldMfoldconsume takeWhile dropWhiledropheadEOFChunksreturnIyieldcontinuerunrun_ throwError catchError>>====<<$$>==><==< printChunksenumList concatEnumsjoinI=$joinE$=sequenceenumEOF checkDoneEx checkDoneisEOFtryIOcheckContinue0checkContinue1 liftTransliftIpeeklastlengthspanbreakfoldlfoldl' liftFoldL liftFoldL' liftFoldMunfoldunfoldMmapAccum mapAccumMtakerequireisolate splitWhen enumHandleenumHandleRangeenumFile enumFileRange iterHandleCodeclinesencodedecodeutf8utf16_leutf16_beutf32_leutf32_beascii iso8859_1pad0reprCharreprWordtSpanBytlSpanBy textToStrictbase GHC.Exception toException SomeException Data.MaybeNothing$fApplicativeStream$fTypeable1Step$fTypeable1Iteratee$fTypeable1StreamGHC.List Control.MonadGHC.Base GHC.IO.IOModeReadMode ReadWriteModegetBytes WriteModetoChunks codecName codecEncode codecDecode byteSplits splitSlowly utf16Requiredutf32SplitBytes illegalEnc illegalDec tryEvaluate maybeDecode