Thomas Davie wrote:
No, I think it's extremely useful. It highlights that numbers can both
be lazy and strict, and that the so called useless lazy sum, is in
fact, useful.
But lazy sum should have beed defined in terms of foldr, not foldl. And
foldl is not strict enough for strict sum.
On Thu, Jun 18, 2009 at 9:14 AM, Gleb Alexeyev gleb.alex...@gmail.comwrote:
Thomas Davie wrote:
No, I think it's extremely useful. It highlights that numbers can both be
lazy and strict, and that the so called useless lazy sum, is in fact,
useful.
But lazy sum should have beed defined in
However it does not work as I expected. I ´m interested in memory
management.
I though that
ghci let l= [1..100]
ghci foldl' (+) 0 l
would produce a stack overflow, since the list can not be freed, because l
points to the beginning of the list
however it succeed
My conclussion is that, in
On Thu, Jun 18, 2009 at 6:38 PM, Alberto G. Coronaagocor...@gmail.com wrote:
My question is: Why the process does not grow also in the lazy case and
instead produces a stack overflow inmediately?
This question is answered in detail on the Wiki
Very informative. The list is in the heap but the lazy sum of foldl is in
the stack. ok.I suppose that all tail recursive functions are detected by
the strictness analysis.
2009/6/18 Chaddaï Fouché chaddai.fou...@gmail.com
On Thu, Jun 18, 2009 at 6:38 PM, Alberto G. Coronaagocor...@gmail.com