[project @ 2004-12-21 12:22:22 by simonpj]
authorsimonpj <unknown>
Tue, 21 Dec 2004 12:23:03 +0000 (12:23 +0000)
committersimonpj <unknown>
Tue, 21 Dec 2004 12:23:03 +0000 (12:23 +0000)
commit79a8b87c0bd61d56b4cf45bd584c9174aab48e61
treeba9661597d6e6ab2f9d939459fd11d279c26813a
parentd673a348ba1a8c41e9eaeb255e0c43156d883526
[project @ 2004-12-21 12:22:22 by simonpj]
---------------------------------
     Improve handling of lexically scoped type variables
---------------------------------

If we have

f :: T a -> a
f (x :: T b) = ...

then the lexically scoped variable 'b' should refer to the rigid
type variable 'a', without any intervening wobbliness.  Previously
the in-scope type variables were always mutable TyVars, which were
instantatiated to point to the type they were bound to; but since
the advent of GADTs the intervening mutable type variable is a bad
thing.

Hence
  * In the type environment, ATyVar now carries a type
  * The call to refineTyVars in tc_pat on SigPatIn
    finds the types by matching
  * Then tcExtendTyVarEnv3 extends the type envt appropriately

Rater a lot of huff and puff, but it's quite natural for ATyVar
to contain a type.

Various other small nomenclature changes along the way.
15 files changed:
ghc/compiler/coreSyn/Subst.lhs
ghc/compiler/specialise/Rules.lhs
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcEnv.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/typecheck/TcHsType.lhs
ghc/compiler/typecheck/TcPat.lhs
ghc/compiler/typecheck/TcRnTypes.lhs
ghc/compiler/typecheck/TcSplice.lhs
ghc/compiler/typecheck/TcType.lhs
ghc/compiler/typecheck/TcUnify.lhs
ghc/compiler/types/FunDeps.lhs
ghc/compiler/types/InstEnv.lhs
ghc/compiler/types/Type.lhs
ghc/compiler/types/Unify.lhs