Fix Trac #2985: generating superclasses and recursive dictionaries
authorsimonpj@microsoft.com <unknown>
Fri, 30 Jan 2009 15:27:38 +0000 (15:27 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 30 Jan 2009 15:27:38 +0000 (15:27 +0000)
commitc04a5fe3e2867d59ce9757069fdd20c06c326724
tree7ae156deff02a2ce8b57a3e3b72af048ddc4fc4a
parent6a104dcf597f27887f0f1ac82dba7051ed2fe0c3
Fix Trac #2985: generating superclasses and recursive dictionaries

The Note [Recursive instances and superclases] explains the subtle
issues to do with generating the bindings for superclasses when
we compile an instance declaration, at least if we want to do the
clever "recursive superclass" idea from the SYB3 paper.

The old implementation of tcSimplifySuperClasses stumbled when
type equalities entered the picture (details in the Note); this
patch fixes the problem using a slightly hacky trick.  When we
re-engineer the constraint solver we'll want to keep an eye on
this.

Probably worth merging to the 6.10 branch.
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcSimplify.lhs