Yes. Though the situation is only that rosy in Haskell under some circumstances. It's easy to get space leaks that make your program use O(run-time) memory, if you are not careful with the laziness.
Re:Is Scala really Faster than Java?
by loup-vaillant on Tuesday June 21, 2011 @05:38PM
(#2680540)
Agreed. My only point is that automatic fusion (stream, shortcut, and even inlining in general) "works" more often in a pure and lazy setting.
That's not an optimization any more, that's a language feature.