[Haskell-beginners] A first try
Panagiotis Koutsourakis
kutsurak at gmail.com
Fri Jun 24 15:22:25 CEST 2011
Hi David,
Thanks very much for your reply. I'll take a look at IterateIO and I
didn't know about hpaste.org, so i'll check it out as well.
On Fri, Jun 24, 2011 at 2:43 PM, David Place <d at vidplace.com> 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.
>
> Luck for you the best example program is an implementation of wc!
>
> I posted it in hpaste.org. (A Haskell-specific version of pasteBin.)
>
>> http://hpaste.org/48254
>
> Cheers,
> David
>
> ____________________
> David Place
> Owner, Panpipes Ho! LLC
> http://panpipesho.com
> d at 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:
>>
>> http://pastebin.com/JZw22QGA
>>
>> Thanks in advance!
>>
>> --
>> Panagiotis Koutsourakis
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>
>
--
Panagiotis Koutsourakis
More information about the Beginners
mailing list