[Haskell-cafe] Lazy evaluation and tail-recursion
limestrael at gmail.com
Wed Mar 16 18:31:00 CET 2011
A question recently popped into my mind: does lazy evaluation reduce the
need to "proper" tail-recursion?
I mean, for instance :
fmap f  = 
fmap f (x:xs) = f x : fmap f xs
Here fmap is not tail-recursive, but thanks to the fact that operator (:) is
lazy, I think that it may still run in constant space/time, am I right?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe