Re-do superclass solving (again); fixes #10423
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 1 Jun 2015 23:33:14 +0000 (00:33 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 1 Jun 2015 23:50:46 +0000 (00:50 +0100)
commit1189196ce7f064af408c9d16874a4c0b78f3a006
treef67f10ebc8214dc39f2b632f67464a978a493397
parent90fde5220c80bf02d7c6e1d6b4cfe631f068aa0b
Re-do superclass solving (again); fixes #10423

TcInstDcls.tcSuperClasses was getting increasingly baroque as a
succession of tickets (#10423 being the latest) pointed out that
my cunning plan was not so cunning.

The big issue is how to restrict the evidence that we generate
for superclass constraints in an instance declaration to avoid
superclass loops.  See Note [Recursive superclasses] in TcInstDcls
which explains the plan.

The question is how to implement the plan.  The new implementation is
much neater, and is described in Note [Solving superclass constraints]
in TcInstDcls.
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcInteract.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSimplify.hs
compiler/typecheck/TcType.hs
compiler/typecheck/TcValidity.hs