[Haskell-cafe] Re: Iteratee-based IO
Don Stewart
dons at galois.com
Sat Sep 20 23:17:31 EDT 2008
oleg:
> It seems there is another approach, which is neither unsafe nor
> imperative. It relies neither on lazy IO nor on Handles. The input
> data can come from a file or from an embedded (e.g., chunk-encoded or
> encrypted) stream; the depth of embedding is arbitrary. The approach
> is naturally incremental. It permits IO interleaving without any
> unsafe operations. The approach is algebraic and declarative. The
> approach is the topic of the DEFUN08 talk in the morning of
> September 27. The code is already available
>
> http://okmij.org/ftp/Haskell/Iteratee/
> The file
> http://okmij.org/ftp/Haskell/Iteratee/README.dr
>
> describes the other files in that directory. The running example is
> reading lines (terminated by CR, LF or CRLF) from a file descriptor
> and then from the chunk-encoded body. The main example illustrates
> multiplexing across two file descriptors and the full IO
> interleaving. The same line parser is used to process data from the
> file descriptor stream and from the embedded chunk-encoded stream,
> which is incrementally decoded.
>
> The whole code is Haskell98. It is not optimized at all and has no
> GHC-specific pragmas and options. The code has been used for the Wc
> program demonstrated yesterday.
>
> Perhaps the code answers the questions posed yesterday by
> Don. Hopefully one can see several composition modes for the iteratees
> and enumerators; enumerators are just iteratee transformers and
> compose as such.
Wonderful. Thanks Oleg, I'll be studying these on the trip up to
Victoria. See you there!
-- Don
More information about the Haskell-Cafe
mailing list