A (final) re-engineering of the new typechecker
authorsimonpj@microsoft.com <unknown>
Fri, 12 Nov 2010 13:00:11 +0000 (13:00 +0000)
committersimonpj@microsoft.com <unknown>
Fri, 12 Nov 2010 13:00:11 +0000 (13:00 +0000)
commitc80364f8e4681b34e974f5df36ecdacec7cd9cd8
treec6d98d7a3d72a76677f1231dfd2a28bc822ca3bb
parent9ba922ee06b048774d7a82964867ff768a78126e
A (final) re-engineering of the new typechecker

Regression testing and user feedback for GHC 7.0 taught
us a lot.  This patch fixes numerous small bugs, and some
major ones (eg Trac #4484, #4492), and improves type
error messages.

The main changes are:

* Entirely remove the "skolem equivalance class" stuff;
  a very useful simplification

* Instead, when flattening "wanted" constraints we generate
  unification variables (not flatten-skolems) for the
  flattened type function application

* We then need a fixup pass at the end, TcSimplify.solveCTyFunEqs,
  which resolves any residual equalities of form
      F xi ~ alpha

* When we come across a definite failure (e.g. Int ~ [a]),
  we now defer reporting the error until the end, in case we
  learn more about 'a'.  That is particularly important for
  occurs-check errors.  These are called "frozen" type errors.

* Other improvements in error message generation.

* Better tracing messages
compiler/typecheck/Inst.lhs
compiler/typecheck/TcCanonical.lhs
compiler/typecheck/TcErrors.lhs
compiler/typecheck/TcInteract.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcSMonad.lhs
compiler/typecheck/TcSimplify.lhs
compiler/typecheck/TcType.lhs
compiler/types/Coercion.lhs