[Haskell-beginners] A first try

Heinrich Apfelmus apfelmus at quantentunnel.de
Sat Jun 25 11:39:51 CEST 2011

David Place wrote:
> Hi, Panagiotis.
> The wc program is a good choice for a learning program, but it
> reveals a long-standing weakness in Haskell: Lazy-IO.  I think you
> will find that your program will get an error if you try to run wc on
> many files.  You will open too many files at once.
> There is a solution called IterateeIO.  It's extremely elegant and
> very good Haskell, but quite challenging to understand.  So far, I
> have not found a good tutorial.

Personally, I think that lazy IO is not a weakness and works extremely 
well for prototyping. In contrast, I find IterateeIO to be ugly and 
non-idiomatic Haskell, since it exposes implementation details and is 
not built on an algebraic "combinators & laws" approach. Being 
challenging to understand is not a substitute for beauty.

Best regards,
Heinrich Apfelmus


More information about the Beginners mailing list