[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

Henning Thielemann lemming at henning-thielemann.de
Mon Mar 2 20:03:36 EST 2009

On Mon, 2 Mar 2009, John Lato wrote:

> Hello,
> I am not a super-geek (at least, not compared to others on this list),
> but I'll take a try at this anyway.  The benefits of iteratees mostly
> depend on differences between lazy and strict IO (see ch. 7 of Real
> World Haskell for more on this).

Maybe a good text for

While I think that the Iteratee pattern has benefits, I suspect that it 
can't be combined with regular lazy functions, e.g. of type [a] -> [a]. 
Say I have a chain of functions: read a file, parse it into a tag soup, 
parse that into an XML tree, transform that tree, format that into a 
string, write that to a file, and all of these functions are written in a 
lazy way, which is currently considered good style, I can't use them in 
conjunction with iteratees. This means, almost all Haskell libraries have 
to be rewritten or extended from lazy style to iteratee style. The 
question for me is then: Why having laziness in Haskell at all? Or at 
least, why having laziness by default, why not having laziness annotation 
instead of strictness annotation.

More information about the Haskell-Cafe mailing list