[Haskell-cafe] A home-brew iteration-alike library: some extension quiestions

John Lato jwlato at gmail.com
Mon Dec 13 13:28:41 CET 2010


From: oleg at okmij.org

>
> Just for the record: the library IterateeM.hs, uses NO extensions to
> Haskell98, let alone Haskell2010. The library as written requires
> LowLevelIO.hs, which uses FFI (which has been Haskell98 addendum and
> is in proper Haskell2010). The sample code, Wc.hs, for example, is
> Haskell98. So, the iteratee can be written with no extensions
> whatsoever.
>

Related to this, IterateeM.hs and LowLevelIO.hs don't use runtime exceptions
either, which I consider a particularly nice feature.


>
> In particular, IterateeM does not use any monad transformer library
> (although it could have). I found that the trouble of writing a state
> monad for a particular state is negligible compared to the pain of
> choosing a particular monad transformer library, and especially the
> pain inflicted on the users who have to deal with many a conflicts of
> monad transformer libraries.
>
>
> > The problem was that I wished Zippee. It means that external enumerator
> > must be "suspended" at some points so Zippee can process elements from
> > both left and right streams in desired order. It makes any other
> > approach I considered impossible to use.
>
> The file IterateeN.hs demonstrates zipping two streams together (in
> lock-step and not in-lockstep). It turns out, the existing Iteratee
> interface and type suffices. This is described in more detail in:
>
> Parallel composition of iteratees: one source to several sinks
> http://okmij.org/ftp/Streams.html#1enum2iter
>
> Parallel composition of streams: several sources to one sink
> http://okmij.org/ftp/Streams.html#2enum1iter
>

It seems I was mistaken in my last reply.  That's what I get for answering
before I read through all my weekend email.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20101213/3bbe58d4/attachment.htm>


More information about the Haskell-Cafe mailing list