úÎZ±V¦@      !"#$%&'()*+,-./0123456789:;<=>?portablejmillikin@gmail.com.KIn 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 ( e a m b), s can ) be considered step transformers of type   e a m b -> m ( e 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 type of error will depend on the  and/or   -- common choices are @ and AB. The 1 has received enough input to generate a result. C 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  . 'Not to be confused with types from the Stream or   stream-fusion packages, a   is a sequence of chunks  generated by an . In contrast to Oleg s implementation, C this stream does not support error handling -- errors encountered / while generating a stream are reported in the  type instead.  (Chunks [])8 is used to indicate that a stream is still active, but H currently has no available data. Iteratees should ignore empty chunks. Lift an + onto a monad transformer, re-wrapping the   s inner monadic values.  returnI x = Iteratee (return x) 'yield x chunk = returnI (Yield x chunk) !continue k = returnI (Continue k) $throwError err = returnI (Error err)  liftI f = continue (returnI . f) Equivalent to (>>=), but 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.  (>==>) e1 e2 s = e1 s >>== e2 (<==<) = flip (>==>)Consume all input until  (, then return consumed input as a list. Return C if the next   is  . )Lifts a pure left fold into an iteratee. As !, but strict in its accumulator. ,Lifts a monadic left fold into an iteratee. ERun an iteratee until it finishes, and return either the final value 0 (if it succeeded) or the error (if it failed). Print chunks as they',re received from the enumerator, optionally  printing empty chunks. ,The most primitive enumerator; simply sends  . The iteratee must = either yield a value or throw an error continuing receiving   will & not terminate with any useful value. FAnother small, useful enumerator separates an input list into chunks, N and sends them to the iteratee. This is useful for testing iteratees in pure  code. !Compose a list of s using '(>>==)' "" is used to  flatten   s into an  . #A common pattern in % implementations is to check whether  the inner 0 has finished, and if so, to return its output.  #, passes its parameter a continuation if the  / can still consume input, or yields otherwise. $%&'()*+,-  break p = , (not . p).  !"#$%&'()*+,-.    !#$%"&'()*+,-.   !"#$%&'()*+,-DEDEDEportablejmillikin@gmail.com.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.  Buffer size /;Opens a file path in binary mode, and passes the handle to .. " The file will be closed when the  finishes. 0ERead 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. 1;Opens a file path in binary mode, and passes the handle to 0. " The file will be closed when the  finishes. ./01./10./01portablejmillikin@gmail.com2FGHI3: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. 49Opens a file path in text mode, and passes the handle to 3. " The file will be closed when the  finishes. 5BRead 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. 69Opens a file path in text mode, and passes the handle to 5. " The file will be closed when the  finishes. 789:;J<=K>?LMN23456789:;<=>?34562789:;<=>?23456789:;<=>?O      !"#$%&'()*+,-./01234562345789:;<=>?@AB@CD@CDEFGHI6JKLMNOPQRenumerator-0.2Data.EnumeratorData.Enumerator.IOData.Enumerator.TextData.Enumerator.Util Enumeratee EnumeratorIteratee runIterateeStepErrorYieldContinueStreamEOFChunks liftTransreturnIyieldcontinue throwErrorliftI catchError>>====<<$$>==><==<consumeisEOF liftFoldL liftFoldL' liftFoldMrun printChunksenumEOFenumList concatEnumsjoinI checkDonemapsequenceheadpeeklastlengthdrop dropWhilespanbreak enumHandleenumFile iterHandleiterFileCodecencodedecodeutf8utf16_leutf16_beutf32_leutf32_beascii iso8859_1baseGHC.BaseString GHC.Exception SomeExceptionghc-primGHC.BoolTruetryStep mapEither codecName codecEncode codecDecode utf16Requiredutf32SplitBytes illegalEnc illegalDec unsafeTryDec