diff options
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r-- | compiler/GHC/Core/InstEnv.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Core/TyCo/FVs.hs | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/compiler/GHC/Core/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs index bb7315074f..f06f12e89a 100644 --- a/compiler/GHC/Core/InstEnv.hs +++ b/compiler/GHC/Core/InstEnv.hs @@ -232,10 +232,8 @@ pprInstances ispecs = vcat (map pprInstance ispecs) instanceHead :: ClsInst -> ([TyVar], Class, [Type]) -- Returns the head, using the fresh tyvars from the ClsInst -instanceHead (ClsInst { is_tvs = tvs, is_tys = tys, is_dfun = dfun }) +instanceHead (ClsInst { is_tvs = tvs, is_cls = cls, is_tys = tys }) = (tvs, cls, tys) - where - (_, _, cls, _) = tcSplitDFunTy (idType dfun) -- | Collects the names of concrete types and type constructors that make -- up the head of a class instance. For instance, given `class Foo a b`: diff --git a/compiler/GHC/Core/TyCo/FVs.hs b/compiler/GHC/Core/TyCo/FVs.hs index 3685876fa4..689503ef89 100644 --- a/compiler/GHC/Core/TyCo/FVs.hs +++ b/compiler/GHC/Core/TyCo/FVs.hs @@ -31,7 +31,7 @@ module GHC.Core.TyCo.FVs noFreeVarsOfType, noFreeVarsOfTypes, noFreeVarsOfCo, -- * Free type constructors - tyConsOfType, + tyConsOfType, tyConsOfTypes, -- * Free vars with visible/invisible separate visVarsOfTypes, visVarsOfType, @@ -1069,7 +1069,7 @@ tyConsOfType ty go ty | Just ty' <- coreView ty = go ty' go (TyVarTy {}) = emptyUniqSet go (LitTy {}) = emptyUniqSet - go (TyConApp tc tys) = go_tc tc `unionUniqSets` go_s tys + go (TyConApp tc tys) = go_tc tc `unionUniqSets` tyConsOfTypes tys go (AppTy a b) = go a `unionUniqSets` go b go (FunTy af w a b) = go w `unionUniqSets` go a `unionUniqSets` go b @@ -1108,12 +1108,13 @@ tyConsOfType ty -- this last case can happen from the tyConsOfType used from -- checkTauTvUpdate - go_s tys = foldr (unionUniqSets . go) emptyUniqSet tys go_cos cos = foldr (unionUniqSets . go_co) emptyUniqSet cos go_tc tc = unitUniqSet tc go_ax ax = go_tc $ coAxiomTyCon ax +tyConsOfTypes :: [Type] -> UniqSet TyCon +tyConsOfTypes tys = foldr (unionUniqSets . tyConsOfType) emptyUniqSet tys {- ********************************************************************** * * |