Type families: new algorithm to solve equalities
[ghc-hetmet.git] / compiler / types / Type.lhs
index 7163079..d80bd52 100644 (file)
@@ -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