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

Henning Thielemann lemming at henning-thielemann.de
Thu Mar 5 17:52:10 EST 2009


On Wed, 4 Mar 2009, John Lato wrote:

>> John A. De Goes schrieb:
>>
>>> Elsewhere, laziness can be a real boon, so I don't understand your
>>> question, "Why have laziness in Haskell at all?"
>>
>> As I have written, many libaries process their data lazily (or could be
>> changed to do so without altering their interface) but their interface
>> can forbid application to data that is fetched from the outside world.
>> Say you are used to 'map', 'filter', 'foldr' - you cannot use them on
>> data fetched by the iteratee/enumerator approach.
>>
>
> Thank you for replying to this; it's good to see what features people
> would like to make iteratees more useful.
>
> Where did you get the idea that you can't use 'map'?

What I meant was, that you cannot just use the functions you are used from 
Data.List. You need functions adapted to Iteratee. This also implies that 
all libraries written in terms of Data.List functions cannot be used as 
they are. Maybe it's a good time to review those libraries, whether they 
need lists at all, or whether they would also work with functionality that 
can be provided by Iteratees. The question, whether libraries should be 
bound to lists and Strings did already arise with ByteStrings. So 
Iteratees may be just one more reason to generalize the libraries.


More information about the Haskell-Cafe mailing list