Why is full-laziness a default optimization?
问题 Full laziness has been repeatedly demonstrated to cause space leaks. Why is full laziness on from -O onwards? I find myself unconvinced by the reasoning in SPJ's The Implementation of Functional Programming Languages. The claim is that in f = \y -> y + sqrt 4 sqrt 4 is unnecessarily repeated each time f is entered so we should float it outside the lambda. I agree in the small, but since we've seen what problems this transformation causes in the large I don't believe it is worth it. It seems