úÎx‚mݵ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ ‘ ’ “ ” • – — ˜ ™ š › œ Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨©ª«¬­®¯°±²³´GEnable map functions for containers that require class contexts on the 7 element types. For lists, this is identical to plain µ. LNullPoint class. Containers that have a null representation, corresponding  to Data.Monoid.mempty. Nullable container class  ,Class of streams which can be filled from a ¶. Typically these , are streams which can be read from a file, Handle, or similar resource. #The pointer must not be used after  readFromPtr completes. 8The Int parameter is the length of the data in *bytes*.      ·¸¹º» GAlas, GHC provides no function to read from Fd to an allocated buffer. G The library function fdRead is not appropriate as it returns a string  already. I'!d rather get data from a buffer. C Furthermore, fdRead (at least in GHC) allocates a new buffer each E time it is called. This is a waste. Yet another problem with fdRead 9 is in raising an exception on any IOError or even EOF. I' d rather  avoid exceptions altogether. 4The following fseek procedure throws no exceptions. ¼½¾ 0poll if file descriptors have something to read - Return the list of read-pending descriptors      An Iteratee exception specified by a String. The Iteratee needs more data but received EOF. A seek request within an Iteratee. Root of iteratee exceptions.  A class for iteratee exceptions. Only inheritants of  IterException $ should be instances of this class. The enumerator received an  it could not handle. &Create an enumerator exception from a String. The iteratee diverged upon receiving EOF.  !+Root of the Iteratee exception hierarchy.  IFException derives from  Control.Exception.SomeException.  , , ( and all inheritants are descendents of "!. "¿ÀÁÂ# Create an   from a string. $ Convert an  to an  . Meant to be used  within an  Enumerator) to signify that it could not handle the   IterException. %&' Create an iteratee exception from a string. ! This convenience function wraps  and Ã.  !"#$%&'!" #'$%& !""#$%&'(Monadic iteratee )*+)Describe the status of a stream of data. ,-./CA stream is a (continuing) sequence of elements bundled in Chunks. 8 The first variant indicates termination of the stream. ; Chunk a gives the currently available part of the stream. # The stream is not terminated yet. F The case (null Chunk) signifies a stream with no currently available @ data but which is still continuing. A stream processor should,  informally speaking, ``suspend itself'' and wait for more data  to arrive. 012 Produce the 16 error message. If the stream was terminated because & of an error, keep the error message. 34567Ä8Send 1 to the Iteratee* and disregard the unconsumed part of the F stream. If the iteratee is in an exception state, that exception is  thrown with Control.Exception.throw#. Iteratees that do not terminate  on EOF will throw . 9HRun an iteratee, returning either the result or the iteratee exception. J Note that only internal iteratee exceptions will be returned; exceptions  thrown with Control.Exception.throw or Control.Monad.CatchIO.throw will  not be returned. See "! for details. :"Transform a computation inside an Iteratee. ;6Lift a computation in the inner monad of an iteratee. BA simple use would be to lift a logger iteratee to a monad stack.  ! logger :: Iteratee String IO ()  logger = mapChunksM_ putStrLn  . loggerG :: MonadIO m => Iteratee String m ()  loggerG = ilift liftIO logger FA more complex example would involve lifting an iteratee to work with * interleaved streams. See the example at Data.Iteratee.ListLike.merge. ÅMap a function over a stream. 4 !"#$%&'()*+,-./0123456789:;/10+.-,()*89:;345672()*)*+.-,,-./100123456789:;(ÆÇ<:Each enumerator takes an iteratee and returns an iteratee + an Enumerator is an iteratee transformer. = The enumerator normally stops when the stream is terminated F or when the iteratee moves to the done state, whichever comes first. 3 When to stop is of course up to the enumerator... =>È?-Report and propagate an unrecoverable error. F Disregard the input first and then propagate the error. This error  cannot be handled by `, although it can be cleared  by A. @HReport and propagate a recoverable error. This error can be handled by  both ` and A. A(Check if an iteratee produces an error.  Returns Right a+ if it completes without errors, otherwise  Left SomeException. A& is useful for iteratees that may not  terminate, such as Data.Iteratee.head with an empty stream. BThe identity iteratee. Doesn't do any processing of input. C&Get the stream status of an iteratee. DSkip the rest of the stream E!Seek to a position in the stream FDMap a monadic function over the chunks of the stream and ignore the I result. Useful for creating efficient monadic iteratee consumers, e.g.  + logger = mapChunksM_ (liftIO . putStrLn) Bthese can be efficiently run in parallel with other iteratees via  Data.Iteratee.ListLike.zip. GA fold over chunks H'Get the current chunk from the stream. I*Get a list of all chunks from the stream. JJUtility function for creating enumeratees. Typical usage is demonstrated  by the breakE definition.  breakE / :: (Monad m, LL.ListLike s el, NullPoint s)  => (el -> Bool)  -> Enumeratee s s m a / breakE cpred = eneeCheckIfDone (liftI . step)  where  step k (Chunk s) % | LL.null s = liftI (step k) / | otherwise = case LL.break cpred s of  (str', tail') N | LL.null tail' -> eneeCheckIfDone (liftI . step) . k $ Chunk str' C | otherwise -> idone (k $ Chunk str') (Chunk tail') 6 step k stream = idone (k stream) stream K:The same as eneeCheckIfDonePass, with one extra argument:  a handler which is used 1 to process any exceptions in a separate method. LMNDConvert one stream into another with the supplied mapping function. B This function operates on whole chunks at a time, contrasting to   mapStream$ which operates on single elements. 1 unpacker :: Enumeratee B.ByteString [Word8] m a  unpacker = mapChunks B.unpack OConvert a stream of s to a stream of s' using the supplied function. P>Convert one stream into another, not necessarily in lockstep. @ The transformer mapStream maps one element of the outer stream E to one element of the nested stream. The transformer below is more F general: it may take several elements of the outer stream to produce ; one element of the inner stream, or the other way around. A The transformation from one stream to the other is specified as  Iteratee s m s'. QIThe most general stream converter. Given a function to produce iteratee G transformers and an initial state, convert the stream using iteratees J generated by the function while continually updating the internal state. RSACollapse a nested iteratee. The inner iteratee is terminated by EOF. - Errors are propagated through the result. GThe stream resumes from the point of the outer iteratee; any remaining , input in the inner iteratee will be lost.  Differs from Control.Monad.join+ in that the inner iteratee is terminated, 8 and may have a different stream type than the result. T0Lift an iteratee inside a monad to an iteratee. U6Applies the iteratee to the given stream. This wraps V,  W, and \%, calling the appropriate enumerator  based upon /. VFThe most primitive enumerator: applies the iteratee to the terminated G stream. The result is the iteratee in the Done state. It is an error , if the iteratee does not terminate on EOF. WFAnother primitive enumerator: tell the Iteratee the stream terminated  with an error. XKThe composition of two enumerators: essentially the functional composition H It is convenient to flip the order of the arguments of the composition , though: in e1 >>> e2, e1 is executed first YEnumeratee composition K Run the second enumeratee within the first. In this example, stream2list  is run within the 'take 10', which is itself run within 'take 15' , resulting  in 15 elements being consumed Yrun =<< enumPure1Chunk [1..1000 :: Int] (joinI $ (I.take 15 ><> I.take 10) I.stream2list)[1,2,3,4,5,6,7,8,9,10]Z7enumeratee composition with the arguments flipped, see Y [DCombine enumeration over two streams. The merging enumeratee would  typically be the result of Data.Iteratee.ListLike.merge or  $Data.Iteratee.ListLike.mergeByChunks (see merge for example). inner enumerator outer enumerator merging enumeratee \The pure 1-chunk enumerator @It passes a given list of elements to the iteratee in one chunk F This enumerator does no IO and is useful for testing of base parsing ]Enumerate chunks from a list ^$Checks if an iteratee has finished. CThis enumerator runs the iteratee, performing any monadic actions. 7 If the result is True, the returned iteratee is done. _.Create an enumerator from a callback function `ICreate an enumerator from a callback function with an exception handler. F The exception handler is called if an iteratee reports an exception. Z !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`&=?@ABDCFGHINOPQRST<>UVW\]^_`XJKML[YZE%<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` +aCheck if a stream has received 1. bCRead a stream to the end and return all of its elements as a list. < This iteratee returns all data from the stream *strictly*. cERead a stream to the end and return all of its elements as a stream. < This iteratee returns all data from the stream *strictly*. dFTakes an element predicate and returns the (possibly empty) prefix of I the stream. None of the characters in the string satisfy the character  predicate. N If the stream is not terminated, the first character of the remaining stream  satisfies the predicate. N.B. p! should be used in preference to break.  break< will retain all data until the predicate is met, which may  result in a space leak. The analogue of  List.break e=Attempt to read the next element of the stream and return it : Raise a (recoverable) error if the stream is terminated. The analogue of  List.head Because head can raise an error, it shouldn't be used when constructing  iteratees for  convStream. Use tryHead instead. f Similar to head, except it returns Nothing if the stream  is terminated. g=Attempt to read the last element of the stream and return it 9 Raise a (recoverable) error if the stream is terminated The analogue of  List.last h>Given a sequence of characters, attempt to match them against = the characters on the stream. Return the count of how many B characters matched. The matched characters are removed from the  stream. % For example, if the stream contains abd, then (heads abc)  will remove the characters ab and return 2. i?Look ahead at the next element of the stream, without removing  it from the stream.  Return Just c if successful, return Nothing if the stream is  terminated by 1. jReturn a chunk of t! elements length while consuming d elements + from the stream. Useful for creating a 'rolling average' with  P. length of chunk (t) amount to consume (d) k7Drop n elements of the stream, if there are that many. The analogue of  List.drop l/Skip all elements while the predicate is true. The analogue of List.dropWhile m=Return the total length of the remaining part of the stream. -This forces evaluation of the entire stream. The analogue of  List.length n(Get the length of the current chunk, or Nothing if 1. !This function consumes no input. oTake n8 elements from the current chunk, or the whole chunk if  n is greater. pATakes an element predicate and an iteratee, running the iteratee ; on all elements of the stream until the predicate is met. the following rule relates break to breakE  break pred === joinI (breakE pred stream2stream) breakE! should be used in preference to break whenever possible. qBRead n elements from a stream and apply the given iteratee to the H stream of the read elements. Unless the stream is terminated early, we C read exactly n elements, even if the iteratee has accepted fewer. The analogue of  List.take number of elements to consume rBRead n elements from a stream and apply the given iteratee to the C stream of the read elements. If the given iteratee accepted fewer  elements, we stop.  This is the variation of q with the early termination K of processing of the outer stream once the processing of the inner stream  finished early. Iteratees composed with r& will consume only enough elements to H reach a done state. Any remaining data will be available in the outer  stream.   > let iter = do  h <- joinI $ takeUpTo 5 I.head  t <- stream2list  return (h,t)  8 > enumPureNChunk [1..10::Int] 3 iter >>= run >>= print  (1,[2,3,4,5,6,7,8,9,10])  8 > enumPureNChunk [1..10::Int] 7 iter >>= run >>= print  (1,[2,3,4,5,6,7,8,9,10]) in each case, I.head4 consumes only one element, returning the remaining  4 elements to the outer stream s<Takes an element predicate and returns the (possibly empty) & prefix of the stream. All characters C in the string will satisfy the character predicate. If the stream / is not terminated, the first character of the 2 remaining stream will not satisfy the predicate. The analogue of List.takeWhile , see also break and  takeWhileE tATakes an element predicate and an iteratee, running the iteratee ; on all elements of the stream while the predicate is met. This is preferred to  takeWhile. u-Map the stream: another iteratee transformer * Given the stream of elements of the type el and the function (el->el'), / build a nested stream of elements of the type el' and apply the  given iteratee to it. The analog of List.map vMap the stream rigidly. Like u&, but the element type cannot change.  This function is necessary for  ByteString and similar types  that cannot have ' instances, and may be more efficient. w Creates an  enumeratee) with only elements from the stream that K satisfy the predicate function. The outer stream is completely consumed. The analogue of  List.filter x Creates an >' in which elements from the stream are  grouped into sz/-sized blocks. The final block may be smaller  than sz. size of group y Creates an  enumeratee$ in which elements are grouped into < contiguous blocks that are equal according to a predicate. The analogue of  List.groupBy zmerge9 offers another way to nest iteratees: as a monad stack. D This allows for the possibility of interleaving data from multiple  streams. / -- print each element from a stream of lines. 5 logger :: (MonadIO m) => Iteratee [ByteString] m () / logger = mapM_ (liftIO . putStrLn . B.unpack)  / -- combine alternating lines from two sources 7 -- To see how this was derived, follow the types from , -- 'ileaveLines logger' and work outwards. 4 run =<< enumFile 10 "file1" (joinI $ enumLinesBS $ ? ( enumFile 10 "file2" . joinI . enumLinesBS $ joinI 0 (ileaveLines logger)) >>= run)  % ileaveLines :: (Functor m, Monad m) E => Enumeratee [ByteString] [ByteString] (Iteratee [ByteString] m)  [ByteString]  ileaveLines = merge (\l1 l2 -> 2 [B.pack "f1:\n\t" ,l1 ,B.pack "f2:\n\t" ,l2 ]   {AA version of merge which operates on chunks instead of elements. 'mergeByChunks offers more control than z. z terminates G when the first stream terminates, however mergeByChunks will continue # until both streams are exhausted. {: guarantees that both chunks passed to the merge function F will have the same number of elements, although that number may vary  between calls. merge function |Left-associative fold. The analogue of  List.foldl }9Left-associative fold that is strict in the accumulator. / This function should be used in preference to | whenever possible. The analogue of  List.foldl'. ~CVariant of foldl with no base case. Requires at least one element  in the stream. The analogue of  List.foldl1. Strict variant of ~. €Sum of a stream. Product of a stream. ‚=Enumerate two iteratees over a single stream simultaneously.  Deprecated, use ƒ instead.  Compare to zip. ƒ=Enumerate two iteratees over a single stream simultaneously.  Compare to List.zip. „…†‡GEnumerate over two iteratees in parallel as long as the first iteratee L is still consuming input. The second iteratee will be terminated with EOF H when the first iteratee has completed. An example use is to determine - how many elements an iteratee has consumed:  * snd <$> enumWith (dropWhile (<5)) length  Compare to zip ˆBEnumerate a list of iteratees over a single stream simultaneously C and discard the results. This is a different behavior than Prelude's A sequence_ which runs iteratees in the list one after the other.  Compare to Prelude.sequence_. ‰The pure n-chunk enumerator 9 It passes a given stream of elements to the iteratee in n-sized chunks. ŠFMap a monadic function over the elements of the stream and ignore the  result. ‹The analogue of Control.Monad.foldM … !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹+abcdlkefghijmnopqrstuvwxyz{|}~€‰‚‡ƒ„…†ˆŠ‹+abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ Œ4Print lines as they are received. This is the first impure iteratee 2 with non-trivial actions during chunk processing .Only lines ending with a newline are printed, + data terminated with EOF is not printed. "Print lines as they are received. @All lines are printed, including a line with a terminating EOF. < If the final line is terminated by EOF without a newline,  no newline is printed. J this function should be used in preference to printLines when possible, + as it is more efficient with long lines. É=Convert the stream of characters to the stream of lines, and 3 apply the given iteratee to enumerate the latter. ? The stream of lines is normally terminated by the empty line. B When the stream of characters is terminated, the stream of lines  is also terminated. I This is the first proper iteratee-enumerator: it is the iteratee of the 9 character stream and the enumerator of the line stream. =Convert the stream of characters to the stream of words, and 3 apply the given iteratee to enumerate the latter. % Words are delimited by white space. $ This is the analogue of List.words ‘Œ‘Œ‘Œ‘ ’Indicate endian-ness. “/Least Significan Byte is first (little-endian) ”,Most Significant Byte is first (big-endian) •–—GRead 3 bytes in an endian manner. If the first bit is set (negative), < set the entire first byte so the Int32 will be negative as  well. ˜™’“”•–—˜™’”“•–—˜™’”““”•–—˜™ ÊšDThe enumerator of a POSIX File Descriptor. This version enumerates A over the entire contents of a file, in order, unless stopped by 9 the iteratee. In particular, seeking is not supported. ›:A variant of enumFd that catches exceptions raised by the Iteratee. œ:The enumerator of a POSIX File Descriptor: a variation of enumFd that $ supports RandomIO (seek requests). ËProcess a file using the given Iteratee. !Buffer size (number of elements) 1A version of fileDriverFd that supports seeking. Ì Buffer size Ÿ Buffer size   Buffer size š›œŸ š›œŸ š›œŸ  Í¡DThe (monadic) enumerator of a file Handle. This version enumerates A over the entire contents of a file, in order, unless stopped by 9 the iteratee. In particular, seeking is not supported. 3 Data is read into a buffer of the specified size. *Buffer size (number of elements per read) ¢AAn enumerator of a file handle that catches exceptions raised by  the Iteratee. *Buffer size (number of elements per read) £;The enumerator of a Handle: a variation of enumHandle that $ supports RandomIO (seek requests). 3 Data is read into a buffer of the specified size. *Buffer size (number of elements per read) Î Buffer size ¤ Buffer size ¥ Buffer size ¦Process a file using the given Iteratee. This function wraps   enumHandle as a convenience. !Buffer size (number of elements) § A version of fileDriverHandle that supports seeking. !Buffer size (number of elements) ¡¢£¤¥¦§¡¢£¤¥¦§¡¢£¤¥¦§¨The default buffer size. ©ª«>Process a file using the given Iteratee. This function wraps  enumFd as a convenience. ¬IA version of fileDriver with a user-specified buffer size (in elements). ­>Process a file using the given Iteratee. This function wraps  enumFdRandom as a convenience. ® šœ¡£¨©ª«¬­® ¨¡£©ªšœ«¬­®¨©ª«¬­®‘ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹’“”•–—˜™«¬­®«¬­®¯3Use an IO function to choose what iteratee to run. 9 -- Typically this function handles user interaction and + -- returns with a simple iteratee such as Ïe or E.  -- * -- The IO function takes a value of type a as input, and  -- should return 'Right a' to continue, or 'Left b' 7 -- to terminate. Upon termination, ioIter will return 'Done b'.  --  -- The second argument to ¯ is used as the initial input = -- to the IO function, and on each successive iteration the A -- previously returned value is used as input. Put another way,  -- the value of type a" is used like a fold accumulator.  -- The value of type b( is typically some form of control code D -- that the application uses to signal the reason for termination. ¯¯¯°CTransform usual Iteratee into parallel composable one, introducing  one step extra delay. *Ex - time spent in Enumerator working on x' th packet ) Ix - time spent in Iteratee working on x' th packet  z - last packet, y = (z-1)' th packet Bregular Iteratee: E0 - I0, E1 - I1, E2 - I2 .. Ez -> Iz / parallel Iteratee: E0, E1, E2, .. Ez  _ I0_ I1_ .. Iy__ Iz ±DTransform an Enumeratee into a parallel composable one, introducing  one step extra delay, see °. ²BEnumerate a list of iteratees over a single stream simultaneously J and discard the results. Each iteratee runs in a separate forkIO thread, & passes all errors from iteratees up. ³ A variant of °/ with the parallelized iteratee lifted into an  arbitrary MonadIO. ´Perform a parallel map/ reduce. The bufsize parameter controls E the maximum number of chunks to read at one time. A larger bufsize ? allows for greater parallelism, but will require more memory. Implementation of Ğ€ C sum :: (Monad m, LL.ListLike s, Nullable s) => Iteratee s m Int64 - sum = getSum <$> mapReduce 4 (Sum . LL.sum) !maximum number of chunks to read  map function °±²³´²±°³´°±²³´Ñ !"##$$%%&&'()**++,,--../01234456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk l m n o p q r s t u v w x y z { | } ~  € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ ‘ ’ “ ” • – — ˜ ™ š › œ   Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ª « ¯ °±ª«²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞĞÑ Ò Ó ² Ô Õ ÔÖp׋Øiteratee-0.8.7Data.Iteratee.IO.PosixData.Iteratee.Base.LooseMapData.NullPoint Data.Nullable Data.Iteratee.Base.ReadableChunkData.Iteratee.ExceptionData.Iteratee.BaseData.Iteratee.IterateeData.Iteratee.ListLikeData.Iteratee.CharData.Iteratee.BinaryData.Iteratee.IO.FdData.Iteratee.IO.HandleData.Iteratee.IOData.Iteratee.IO.InteractData.Iteratee.ParallelData.Iteratee.IO.Base Data.IterateebaseSystem.Posix.Types FileOffsetForeign.C.ErrorErrnoLooseMaplMap NullPointemptyNullablenullC ReadableChunk readFromPtrmyfdReadmyfdSeekselect'read'pendingIterStringException EofException SeekException IterException IExceptiontoIterExceptionfromIterExceptionEnumUnhandledIterExceptionEnumStringExceptionDivergentException EnumException IFExceptionenStrExc wrapIterExciterExceptionToExceptioniterExceptionFromException iterStrExcIterateerunIter StreamStatusEofError EofNoError DataRemainingStreamChunkEOFsetEOFidoneicontliftIidoneMicontMruntryRun mapIterateeilift EnumeratorEnumerateeHandler EnumerateethrowErrthrowRecoverableErrcheckErridentityisStreamFinished skipToEofseek mapChunksM_ foldChunksMgetChunk getChunkseneeCheckIfDoneeneeCheckIfDoneHandleeneeCheckIfDonePasseneeCheckIfDoneIgnore mapChunks mapChunksM convStreamunfoldConvStreamunfoldConvStreamCheckjoinIjoinIM enumChunkenumEofenumErr>>>><><>< mergeEnumsenumPure1ChunkenumListenumCheckIfDoneenumFromCallbackenumFromCallbackCatch isFinished stream2list stream2streambreakheadtryHeadlastheadspeekrolldrop dropWhilelength chunkLength takeFromChunkbreakEtaketakeUpTo takeWhile takeWhileE mapStreamrigidMapStreamfiltergroupgroupBymerge mergeByChunksfoldlfoldl'foldl1foldl1'sumproductenumPairzipzip3zip4zip5enumWith sequence_enumPureNChunkmapM_foldM printLinesprintLinesUnterminated enumLines enumWords enumWordsBS enumLinesBSEndianLSBMSB endianRead2 endianRead3 endianRead3i endianRead4 endianRead8enumFd enumFdCatch enumFdRandom fileDriverFdfileDriverRandomFdenumFileenumFileRandom enumHandleenumHandleCatchenumHandleRandomfileDriverHandlefileDriverRandomHandledefaultBufSize fileDriverfileDriverVBuffileDriverRandomfileDriverRandomVBufioIterparIparE psequence_liftParI mapReduceGHC.BasemapGHC.PtrPtrTIMEVALFDSETc_selectcLSeekcReadfd2fdsfds2mfdunFdifExceptionToExceptionifExceptionFromExceptionenumExceptionToExceptionenumExceptionFromException GHC.Exception toException bindIteratee$fFunctorStreamNotAnException excDivergent terminatorsmakefdCallback enumFile'makeHandleCallbackGHC.List Data.List