Question About lists

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Thu, 02 Jan 2003 08:39:18 +0000


> 1. Haskell 98 does not explicitly mandate tail recursion optimisation.

However, in practice Haskell compilers must provide this since it is
impossible to write a loop without using recursion and if your loops
don't use constant stack space, you're not going to run for very long.

> (In particular, Hugs doesn't support it fully, as we have seen recently.)

Please note that this is NOT TRUE!

Hugs provides tail recursion just as fully as GHC.

What Hugs does not do is garbage collect unreachable CAFs.  This affects
top level definitions of the form:

   foo = <whatever>

which is the form of all the examples recently discussed.

--
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/