26 Jul
2012
26 Jul
'12
12:31 a.m.
On 12-07-25 09:06 AM, Mathieu Boespflug wrote:
"Albert Y. C. Lai" <trebla@vex.net> writes:
foldr (+) and foldl (+) for Int have the same asymptotic costs, both time and space. See my http://www.vex.net/~trebla/haskell/lazy.xhtml
Therefore, I do not understand why they are labeled opposite space-leakness.
That may be true, but if the function argument supplied to foldr is lazy in its second argument, then the story can be quite different.
In my http://www.vex.net/~trebla/haskell/lazy.xhtml which I mentioned yesterday, I have an example for that, too. foldr (||).