From: simonpj@microsoft.com Date: Thu, 17 Jan 2008 18:02:27 +0000 (+0000) Subject: Add missing extendSubst X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=1286da96dc65faa5992a8a34c5b3bf29dfe2be04;ds=sidebyside Add missing extendSubst Oops -- missed this from previous commit; sorry --- diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs index 9cedf2d..00eaadd 100644 --- a/compiler/coreSyn/CoreSubst.lhs +++ b/compiler/coreSyn/CoreSubst.lhs @@ -23,7 +23,7 @@ module CoreSubst ( emptySubst, mkEmptySubst, mkSubst, substInScope, isEmptySubst, extendIdSubst, extendIdSubstList, extendTvSubst, extendTvSubstList, - extendSubstList, zapSubstEnv, + extendSubst, extendSubstList, zapSubstEnv, extendInScope, extendInScopeList, extendInScopeIds, isInScope, @@ -172,12 +172,13 @@ extendTvSubstList :: Subst -> [(TyVar,Type)] -> Subst extendTvSubstList (Subst in_scope ids tvs) prs = Subst in_scope ids (extendVarEnvList tvs prs) extendSubstList :: Subst -> [(Var,CoreArg)] -> Subst -extendSubstList subst [] - = subst -extendSubstList (Subst in_scope ids tvs) ((tv,Type ty):prs) - = ASSERT( isTyVar tv ) extendSubstList (Subst in_scope ids (extendVarEnv tvs tv ty)) prs -extendSubstList (Subst in_scope ids tvs) ((id,expr):prs) - = ASSERT( isId id ) extendSubstList (Subst in_scope (extendVarEnv ids id expr) tvs) prs +extendSubstList subst [] = subst +extendSubstList subst ((var,rhs):prs) = extendSubstList (extendSubst subst var rhs) prs + +extendSubst (Subst in_scope ids tvs) tv (Type ty) + = ASSERT( isTyVar tv ) Subst in_scope ids (extendVarEnv tvs tv ty) +extendSubst (Subst in_scope ids tvs) id expr + = ASSERT( isId id ) Subst in_scope (extendVarEnv ids id expr) tvs lookupIdSubst :: Subst -> Id -> CoreExpr lookupIdSubst (Subst in_scope ids tvs) v