Fix Trac #1470: improve handling of recursive instances (needed for SYB3)
authorsimonpj@microsoft.com <unknown>
Thu, 18 Sep 2008 16:17:19 +0000 (16:17 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 18 Sep 2008 16:17:19 +0000 (16:17 +0000)
commit5045af3106f3d1e3cb223c254af2de6a8a265797
tree4022ae60495a93f9b528216a1c89673a5e00e86a
parent60dccb046d8fe9e22740a81d1097d32d08fba72b
Fix Trac #1470: improve handling of recursive instances (needed for SYB3)

This bug has been hanging around for a long time, as you'll see by its
number. The fix implements a feature that is really needed by SYB3, to
allow an instance to (rather indirectly) refer to itself.  The trickiness
comes when solving the superclass constraints.

The whoel issue is explained in Note [Recursive instances and superclases]
in TcSimplify.

In cracking this one I found I could remove the WantSCs argument to the
ReduceMe flag, which is a worthwhile simplification.  Good!
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcSimplify.lhs