Yet another major refactoring of the constraint solver
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 7 May 2012 16:40:34 +0000 (17:40 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Mon, 7 May 2012 16:40:34 +0000 (17:40 +0100)
commitdd7522c3b14bce1af94bffd61c4d38e670f53495
treef152f7d024ff407930356a31ca92c1b93023841e
parent4f2dfe1e3f2dffed5fde404ad0309789d114c62c
Yet another major refactoring of the constraint solver

This is the result of Simon and Dimitrios doing a code walk through.
There is no change in behaviour, but the structure is much better.
Main changes:

* Given constraints contain an EvTerm not an EvVar

* Correspondingly, TcEvidence is a recursive types that uses
  EvTerms rather than EvVars

* Rename CtFlavor to CtEvidence

* Every CtEvidence has a ctev_pred field.  And use record fields
  consistently for CtEvidence

* The solved-constraint fields of InertSet (namely inert_solved and
  inert_solved_funeqs) contain CtEvidence, not Ct

There is a long cascade of follow-on changes.
16 files changed:
compiler/coreSyn/CoreUtils.lhs
compiler/deSugar/DsBinds.lhs
compiler/typecheck/Inst.lhs
compiler/typecheck/TcCanonical.lhs
compiler/typecheck/TcErrors.lhs
compiler/typecheck/TcEvidence.lhs
compiler/typecheck/TcHsSyn.lhs
compiler/typecheck/TcInstDcls.lhs
compiler/typecheck/TcInteract.lhs
compiler/typecheck/TcMType.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcSMonad.lhs
compiler/typecheck/TcSimplify.lhs
compiler/typecheck/TcUnify.lhs
compiler/types/Coercion.lhs
compiler/types/Type.lhs