
12 Sep
2012
12 Sep
'12
8:49 a.m.
On Wed, 12 Sep 2012, Niklas Hambüchen wrote:
On 11/09/12 22:23, Ben Millwood wrote:
if you compile with optimisations you may find the memory leak goes away.
Sure, but should users expect the space complexity being O(n) vs O(1) depending on a compiler switch?
Was it intentional that sum is defined in terms of foldl and not foldl'?
I think yes, because (+) can be lazy, as Ben mentioned. Think of the sum of power series. Actually, foldl' would also work for power series, because it evaluates only the top-most constructor. This is also surprising. For me foldl' is quite a hack, since it relies on the hack 'seq'.