
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. Luck for you the best example program is an implementation of wc! I posted it in hpaste.org. (A Haskell-specific version of pasteBin.)
Cheers, David ____________________ David Place Owner, Panpipes Ho! LLC http://panpipesho.com d@vidplace.com On Jun 24, 2011, at 7:48 AM, Panagiotis Koutsourakis wrote:
Hello all,
I've been spending some time recently learning Haskell. I am not a newbie in programming, and I've had some experience with lisp in the past, but I have not really studied functional programming. I am mostly seeking feedback regarding style, and glaring mistakes that I may make in some toy examples, but I am not sure if this is the proper place to ask.
In case it is though, here is an attempt (not yet complete) at the word count program:
Thanks in advance!
-- Panagiotis Koutsourakis
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners