A radical overhaul of the coercion infrastucture
authorsimonpj@microsoft.com <unknown>
Thu, 12 Nov 2009 09:29:06 +0000 (09:29 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 12 Nov 2009 09:29:06 +0000 (09:29 +0000)
commitcd0e2c0cc3005c3f5e74eeda57dc9cebbe1bac7e
tree38625333890893f147e807e253937e6b75b775ce
parent74bc2267c6e884a66cd3e03c218c849519b975f7
A radical overhaul of the coercion infrastucture

* Core Lint now does full checking of kinds and coercion terms
  which picks up kind errors in coercions that were previously
  simply not checked for

* Coercion.lhs now provides optCoercion which optimises coercion
  terms.  It implements all of Dimitrios's rules

* The constructors for coercion terms now make no attempt to be
  "smart"; instead we rely solely on the coercion optimiser

* CoercionTyCons in TyCon.lhs always had a "custom" kinding rule
  (the coKindFun field of CoercionTyCon) but its type was not
  clever enough to do both
     (a) *figure out the result kind*, assuming the whole thing
         is well-kinded in the first place
     (b) *check* the kinds of everything, failing gracefully if
         they aren't right.
  We need (b) for the new CoreLint stuff. The field now has type
        CoTyConKindChecker
  which does the job nicely.
compiler/coreSyn/CoreArity.lhs
compiler/coreSyn/CoreLint.lhs
compiler/prelude/PrelNames.lhs
compiler/types/Coercion.lhs
compiler/types/TyCon.lhs
compiler/types/Type.lhs