adapt HetMet extensions to new GHC coercion representation
merge GHC HEAD
Treat the (~) type constructor a bit specially when kind-checking in Core Lint. It's unusual becuase it is poly-kinded; for example (~) Int a and (~) Maybe b are both ok. We don't want the full generality of kind polymorphism (yet anyway) so these changes in effect give (~) its own private kinding rule. It won't work right if (~) appears un-saturated, and Lint now checks for that too.
update compiler using *->*->* as the kind of environment classifiers
This BIG PATCH contains most of the work for the New Coercion Representation See the paper "Practical aspects of evidence based compilation in System FC" * Coercion becomes a data type, distinct from Type * Coercions become value-level things, rather than type-level things, (although the value is zero bits wide, like the State token) A consequence is that a coerion abstraction increases the arity by 1 (just like a dictionary abstraction) * There is a new constructor in CoreExpr, namely Coercion, to inject coercions into terms
Give seqId the right type
Give the correct kind to unsafeCoerce#
Tidy up AnyTyCon stuff If we find ourselves making up an AnyTyCon of kind '??', say, then default it to liftedTypeKind. And similarly for any sub-kind of LiftedTypeKind. This is just a tidy-up.
Comments only
Substantial improvements to coercion optimisation The main purpose of this patch is to add a bunch of new rules to the coercion optimiser. They are documented in the (revised) Appendix of the System FC paper. Some code has moved about: - OptCoercion is now a separate module, mainly because it now uses tcMatchTy, which is defined in Unify, so OptCoercion must live higehr up in the hierarchy - Functions that manipulate Kinds has moved from Type.lhs to Coercion.lhs. Reason: the function typeKind now needs to call coercionKind. And in any case, a Kind is a flavour of Type, so it builds on top of Type; indeed Coercions and Kinds are both flavours of Type. This change required fiddling with a number of imports, hence the one-line changes to otherwise-unrelated modules - The representation of CoTyCons in TyCon has changed. Instead of an extensional representation (a kind checker) there is now an intensional representation (namely TyCon.CoTyConDesc). This was needed for one of the new coercion optimisations.
Fix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables DO NOT MERGE TO GHC 6.12 branch (Reason: interface file format change.) The typechecker needs to instantiate otherwise-unconstraint type variables to an appropriately-kinded constant type, but we didn't have a supply of arbitrarily-kinded tycons for this purpose. Now we do. The details are described in Note [Any types] in TysPrim. The fundamental change is that there is a new sort of TyCon, namely AnyTyCon, defined in TyCon. Ter's a small change to interface-file binary format, because the new AnyTyCons have to be serialised. I tided up the handling of uniques a bit too, so that mkUnique is not exported, so that we can see all the different name spaces in one module.
Fix Trac #3421: a typo in TysPrim This is just a blatant typo, where Any1 :: *->* was getting mixed up with Any :: *.
Remove GHC's haskell98 dependency
Trim unused imports detected by new unused-import code
Follow OccName changes in TysPrim
TysPrim is now warning-free
(F)SLIT -> (f)sLit in TysPrim
Another round of External Core fixes With this patch, GHC should now be printing External Core in a format that a stand-alone program can parse and typecheck. Major bug fixes: - The printer now handles qualified/unqualified declarations correctly (particularly data constructor declarations) - It prints newtype declarations with enough information to typecheck code that uses the induced coercions (this required a syntax change) - It expands type synonyms correctly Documentation and external tool patches will follow.
Don't import FastString in HsVersions.h Modules that need it import it themselves instead.
Improve the situation for Trac #959: civilised warning instead of a trace msg This doesn't fix the root cause of the bug, but it makes the report more civilised, and points to further info.