Isn't this tail recursive?

Alastair David Reid reid@cs.utah.edu
11 Mar 2002 12:50:01 +0000


> It would be possible to do strict evaluation in the case that the
> suspended computation is known to take a small bounded amount of
> time and space and can't fail - GHC doesn't do this, but we've
> wondered about it from time to time.

I wonder if this would have the side-effect of making Haskell
efficiency even more inscrutable.  "Ah, yes, you would have expected
this to be a bounded, non-failing computation but <insert reason wy
this is a fragile analysis here>"

Difficult tradeoff: compiler that optimizes most of your code
vs. baffling changes in performance for minor changes in how the code
is written.  But it's not just Haskell users that get this - anyone
using a modern processor can experience cache misses (huge performance
cost) in C.

--
Alastair Reid