[Haskell-cafe] Re: Help with IO and randomR

Niko Korhonen niko.korhonen at gmail.com
Mon Jul 16 10:19:46 EDT 2007

Bryan Burgers wrote:
> Uh, I know that's a very poor explanation, but hopefully it gives you
> an alternate way to look at the problem.

Yes, this was extremely helpful, thank you very much. The moments where
one realizes that a large piece of clumsy code can be replaced with a
simple high-level function application seem to be an integral part of
learning Haskell. This time it was zipWith. Previously (for me) it has
been the folds :)

I know that in Haskell there almost always is a high-level solution to a
recursive problem (the legendary "here's a one-line fold that replaces
your entire program"), but sometimes it can be very difficult to see,
especially if IO is involved.


More information about the Haskell-Cafe mailing list