X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreSubst.lhs;h=3fe48009a8b3f9e474ab957ec23c871bc5feb438;hp=f1f02d9b9c9c7bd03540e8aa6383ac0078e38cc0;hb=794c2f4c8829ba3166c9bdb471856bc00c21f001;hpb=94fd9ad3745d9d270648aa5d7d87f49a0dafabd4 diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs index f1f02d9..3fe4800 100644 --- a/compiler/coreSyn/CoreSubst.lhs +++ b/compiler/coreSyn/CoreSubst.lhs @@ -227,10 +227,10 @@ lookupTvSubst (Subst _ _ tvs) v = lookupVarEnv tvs v `orElse` Type.mkTyVarTy v -- No left-right shadowing -- ie the substitution for (\x \y. e) a1 a2 -- so neither x nor y scope over a1 a2 -mkOpenSubst :: [(Var,CoreArg)] -> Subst -mkOpenSubst pairs = Subst (mkInScopeSet (exprsFreeVars (map snd pairs))) - (mkVarEnv [(id,e) | (id, e) <- pairs, isId id]) - (mkVarEnv [(tv,ty) | (tv, Type ty) <- pairs]) +mkOpenSubst :: InScopeSet -> [(Var,CoreArg)] -> Subst +mkOpenSubst in_scope pairs = Subst in_scope + (mkVarEnv [(id,e) | (id, e) <- pairs, isId id]) + (mkVarEnv [(tv,ty) | (tv, Type ty) <- pairs]) ------------------------------ isInScope :: Var -> Subst -> Bool