[Haskell-cafe] curious about sum
Don Stewart
dons at galois.com
Tue Jun 16 11:36:41 EDT 2009
tom.davie:
>
> On 16 Jun 2009, at 05:18, Don Stewart wrote:
>
>> keithshep:
>>> The answer is sometimes (only if you use an optimize flag):
>>
>> You're turning on the strictness analyser. That's enabled with -O or
>> -O2.
>>
>> But sum should be using a tail recursive foldl'. It's a bug in the H98
>> report, IMO.
>
> Not at all, as discussed, there are legitimate uses for a lazy sum, and
> haskell is a lazy language by default. The only change here needs to be
> either claus' suggestion of generalizing functions over their
> application operator, or providing a strict sum'.
Are the legitimate uses more common than the illegitimate uses?
-- Don
More information about the Haskell-Cafe
mailing list