Commit 1286da96 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Add missing extendSubst

Oops -- missed this from previous commit; sorry
parent 44d4bf2c
...@@ -23,7 +23,7 @@ module CoreSubst ( ...@@ -23,7 +23,7 @@ module CoreSubst (
emptySubst, mkEmptySubst, mkSubst, substInScope, isEmptySubst, emptySubst, mkEmptySubst, mkSubst, substInScope, isEmptySubst,
extendIdSubst, extendIdSubstList, extendTvSubst, extendTvSubstList, extendIdSubst, extendIdSubstList, extendTvSubst, extendTvSubstList,
extendSubstList, zapSubstEnv, extendSubst, extendSubstList, zapSubstEnv,
extendInScope, extendInScopeList, extendInScopeIds, extendInScope, extendInScopeList, extendInScopeIds,
isInScope, isInScope,
...@@ -172,12 +172,13 @@ extendTvSubstList :: Subst -> [(TyVar,Type)] -> Subst ...@@ -172,12 +172,13 @@ extendTvSubstList :: Subst -> [(TyVar,Type)] -> Subst
extendTvSubstList (Subst in_scope ids tvs) prs = Subst in_scope ids (extendVarEnvList tvs prs) extendTvSubstList (Subst in_scope ids tvs) prs = Subst in_scope ids (extendVarEnvList tvs prs)
extendSubstList :: Subst -> [(Var,CoreArg)] -> Subst extendSubstList :: Subst -> [(Var,CoreArg)] -> Subst
extendSubstList subst [] extendSubstList subst [] = subst
= subst extendSubstList subst ((var,rhs):prs) = extendSubstList (extendSubst subst var rhs) prs
extendSubstList (Subst in_scope ids tvs) ((tv,Type ty):prs)
= ASSERT( isTyVar tv ) extendSubstList (Subst in_scope ids (extendVarEnv tvs tv ty)) prs extendSubst (Subst in_scope ids tvs) tv (Type ty)
extendSubstList (Subst in_scope ids tvs) ((id,expr):prs) = ASSERT( isTyVar tv ) Subst in_scope ids (extendVarEnv tvs tv ty)
= ASSERT( isId id ) extendSubstList (Subst in_scope (extendVarEnv ids id expr) tvs) prs 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 -> Id -> CoreExpr
lookupIdSubst (Subst in_scope ids tvs) v lookupIdSubst (Subst in_scope ids tvs) v
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment