Kirsten Chevalier wrote:
On 1/31/07, Bill Wood <[EMAIL PROTECTED]> wrote:
On Wed, 2007-01-31 at 19:51 +1100, Donald Bruce Stewart wrote:
   . . .
> foldl (\water dish -> wash water dish) soapywater dishes :: [Dishes]

Nice example.  First, note that you can't get close with map -- you need
accumulation across the dishes. [...]
It also assumes that there's necessarily a natural decomposition on
the dishes, and if you think there is, you haven't seen my kitchen!

Using a lazy fold may not be the best choice.  Although it may
sound enticing to delay washing until a clean dish is actually required
(and having the dirty dishes removed by the garbage collector, hopefully
before they start naturally decomposing), you will quickly run out of stack
space.

-k
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to