X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcType.lhs;h=74100920bbf1aa4dea009b7a3b35d9c715edd1d4;hb=25bff7fe1a22edbafa188af8d844c67057fa5eb8;hp=b20d32eec3a04810a22f513a53170575816ff62c;hpb=27225b0c9f799a251c96242f502e8cfd6bf76d7c;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcType.lhs b/compiler/typecheck/TcType.lhs index b20d32e..7410092 100644 --- a/compiler/typecheck/TcType.lhs +++ b/compiler/typecheck/TcType.lhs @@ -30,7 +30,7 @@ module TcType ( isImmutableTyVar, isSkolemTyVar, isMetaTyVar, isMetaTyVarTy, isSigTyVar, isExistentialTyVar, isTyConableTyVar, metaTvRef, - isFlexi, isIndirect, isRuntimeUnk, isUnk, + isFlexi, isIndirect, isUnkSkol, isRuntimeUnkSkol, -------------------------------- -- Builders @@ -123,7 +123,8 @@ module TcType ( -- Type substitutions TvSubst(..), -- Representation visible to a few friends TvSubstEnv, emptyTvSubst, substEqSpec, - mkOpenTvSubst, zipOpenTvSubst, zipTopTvSubst, mkTopTvSubst, notElemTvSubst, + mkOpenTvSubst, zipOpenTvSubst, zipTopTvSubst, + mkTopTvSubst, notElemTvSubst, unionTvSubst, getTvSubstEnv, setTvSubstEnv, getTvInScope, extendTvInScope, lookupTyVar, extendTvSubst, extendTvSubstList, isInScope, mkTvSubst, zipTyEnv, substTy, substTys, substTyWith, substTheta, substTyVar, substTyVars, substTyVarBndr, @@ -334,6 +335,7 @@ data SkolemInfo | RuleSkol RuleName -- The LHS of a RULE | GenSkol TcType -- Bound when doing a subsumption check for ty + | RuntimeUnkSkol -- a type variable used to represent an unknown -- runtime type (used in the GHCi debugger) @@ -669,15 +671,21 @@ isFlexi _ = False isIndirect (Indirect _) = True isIndirect _ = False -isRuntimeUnk :: TyVar -> Bool -isRuntimeUnk x | isTcTyVar x - , SkolemTv RuntimeUnkSkol <- tcTyVarDetails x = True - | otherwise = False - -isUnk :: TyVar -> Bool -isUnk x | isTcTyVar x - , SkolemTv UnkSkol <- tcTyVarDetails x = True - | otherwise = False +isRuntimeUnkSkol :: TyVar -> Bool +-- Called only in TcErrors; see Note [Runtime skolems] there +isRuntimeUnkSkol x + | isTcTyVar x + , SkolemTv info <- tcTyVarDetails x + = case info of + UnkSkol -> True + RuntimeUnkSkol -> True + _ -> False + | otherwise = False + +isUnkSkol :: TyVar -> Bool +isUnkSkol x | isTcTyVar x + , SkolemTv UnkSkol <- tcTyVarDetails x = True + | otherwise = False \end{code}