[Haskell] Fail <<loop>> ?

Tomasz Zielonka tomasz.zielonka at gmail.com
Sat Jan 8 01:47:40 EST 2005


On Fri, Jan 07, 2005 at 06:27:03PM -0500, Robert Dockins wrote:
> This means your program fails to terminate, and the runtime detected it
> (it can't always).  It is often caused by forgetting to code a base case
> in a recursive function, or by getting it wrong.  Without some code, it
> is hard to say more, but take a close look at all your recursive
> functions.

I would rather look at recursive "non-functions" (CAFs?), because that's where
GHC can sometimes detect nontermination (AFAIK).

I would expect things like these:

    x = x
    x = x + 1
    fibs = 0 : zipWith (+) fibs (tail fibs) -- subtle bug, 0 : 1 : would work

Best regards,
Tomasz


More information about the Haskell mailing list