[Haskell-cafe] Re: Channel9 Interview: Software Composability
and theFu ture of Languages
Ketil Malde
Ketil.Malde at bccs.uib.no
Wed Jan 31 10:49:47 EST 2007
Kirsten Chevalier wrote:
> On 1/31/07, Bill Wood <william.wood3 at comcast.net> 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
More information about the Haskell-Cafe
mailing list