[Haskell-cafe] Either Monad and Laziness

John Lato jwlato at gmail.com
Tue Sep 18 01:58:38 CEST 2012


> Subject: Re: [Haskell-cafe] Either Monad and Laziness
>
> On 9/14/12 5:16 PM, Eric Velten de Melo wrote:
>> But now I'm kinda lost. Is there an easy way to explain the difference between:
>> -iteratee
>> -conduit
>> -enumerator

I tend to group them into three families.  'iteratee' and 'enumerator'
are fairly directly drawn from Oleg's code, with mostly implementation
differences (at least when compared to the other families).  They've
tended to keep Oleg's original names (iteratee, enumerator,
enumeratee).

The biggest user-visible difference between iteratee and enumerator is
the level of datastream abstraction.  iteratee abstracts over the
stream, and enumerator abstracts over elements of the stream.  The
stream is explicitly a list of elements.  This exposes some of the
details of data chunking to the user, which has both advantages and
disadvantages (iteratee exposes this also, but it's not necessary as
is the case for enumerator).

The second family (chronologically) includes conduit and (maybe)
iterIO.  I've written a little about this group at
http://johnlato.blogspot.sg/2012/06/understandings-of-iteratees.html
Although they serve the same goals in spirit, the implementation may
or may not necessarily be an iteratee/enumerator arrangement (e.g.
conduit).  This is a technical observation, not a criticism, depending
on exactly what you consider to define the style in the first place.
This group has usually renamed functions.  I discuss some of the other
differences on my blog.

The third familiy is all the pipes-* stuff.  This group tends towards
emphasizing the relationship between iteratee/enumerator pairs and
coroutines, and also emphasizing (to use Oleg terminology) composition
of enumeratees.  I've been meaning to write more about this group, but
thus far have been unable to do so.

I'd rather not hijack by evangelizing, but obviously I think iteratee
provides several important advantages over the other options.

John L.



More information about the Haskell-Cafe mailing list