X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=d80bd52c0ee6cb948ca508af51a93bb04aceebe4;hp=716307966c219ad4e7abdf880f28f59fccf5221f;hb=c4ec8f2a77894af1c6160c4e8ad5625ab62f0bea;hpb=f38871fdd92e466cbbc7eb08e226c4213bcbd7d6 diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index 7163079..d80bd52 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -128,7 +128,7 @@ module Type ( isEmptyTvSubst, -- ** Performing substitution on types - substTy, substTys, substTyWith, substTheta, + substTy, substTys, substTyWith, substTysWith, substTheta, substPred, substTyVar, substTyVars, substTyVarBndr, deShadowTy, lookupTyVar, -- * Pretty-printing @@ -1514,6 +1514,12 @@ substTyWith :: [TyVar] -> [Type] -> Type -> Type substTyWith tvs tys = ASSERT( length tvs == length tys ) substTy (zipOpenTvSubst tvs tys) +-- | Type substitution making use of an 'TvSubst' that +-- is assumed to be open, see 'zipOpenTvSubst' +substTysWith :: [TyVar] -> [Type] -> [Type] -> [Type] +substTysWith tvs tys = ASSERT( length tvs == length tys ) + substTys (zipOpenTvSubst tvs tys) + -- | Substitute within a 'Type' substTy :: TvSubst -> Type -> Type substTy subst ty | isEmptyTvSubst subst = ty