[project @ 2004-12-06 10:51:36 by simonpj]
authorsimonpj <unknown>
Mon, 6 Dec 2004 10:51:36 +0000 (10:51 +0000)
committersimonpj <unknown>
Mon, 6 Dec 2004 10:51:36 +0000 (10:51 +0000)
commitf6f3819f37d73eeaaffa7bf45126ce73fb53e72b
treea732d9d0e30b7d30d447d4ddd340a490b54b1f76
parent23843129c0eb7338e99d3edebb6e67f669557dc1
[project @ 2004-12-06 10:51:36 by simonpj]
------------------------------------
Bug in loop detection in TcSimplify
------------------------------------

The type-class context simplifier has been able to
build recursive dictionaries for some time: co-induction.
That is, you can build a proof for constraint C by assuming
that C holds when proving the preconditions of C.

You need to be in -fallow-undecidable-instances land to
make use of this: see comments with [RECURSIVE DICTIONARIES]
in TcSimplify.lhs.

Anyway, this is all fine, but I'd implemented it wrong!  You need
to be very careful with superclasses, or you can make a bogus
loop by mistake.  This commit fixes it; tests LoopOfTheDay{1,2,3}
will test it (thanks Ralf Laemmel).
ghc/compiler/typecheck/TcSimplify.lhs