X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreFVs.lhs;h=e2eb3a2e82b2d4de9540870b0743d30a4418ffb0;hp=d2d1383e2b4cc23b978938619e66970a0462073f;hb=296058a1cafa80dec0b3f998348bce7c65f668b0;hpb=25b72d3e7da625732cbfbbe729a3e4321fd91ced diff --git a/compiler/coreSyn/CoreFVs.lhs b/compiler/coreSyn/CoreFVs.lhs index d2d1383..e2eb3a2 100644 --- a/compiler/coreSyn/CoreFVs.lhs +++ b/compiler/coreSyn/CoreFVs.lhs @@ -25,7 +25,7 @@ module CoreFVs ( exprFreeNames, exprsFreeNames, -- * Free variables of Rules, Vars and Ids - idRuleVars, idFreeVars, varTypeTyVars, + idRuleVars, idFreeVars, varTypeTyVars, varTypeTcTyVars, ruleRhsFreeVars, rulesFreeVars, ruleLhsFreeNames, ruleLhsFreeIds, @@ -370,6 +370,13 @@ varTypeTyVars var | isLocalId var || isCoVar var = tyVarsOfType (idType var) | otherwise = emptyVarSet -- Global Ids and non-coercion TyVars +varTypeTcTyVars :: Var -> TyVarSet +-- Find the type variables free in the type of the variable +-- Remember, coercion variables can mention type variables... +varTypeTcTyVars var + | isLocalId var || isCoVar var = tcTyVarsOfType (idType var) + | otherwise = emptyVarSet -- Global Ids and non-coercion TyVars + idFreeVars :: Id -> VarSet idFreeVars id = ASSERT( isId id) idRuleVars id `unionVarSet` varTypeTyVars id