X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypes%2FType.lhs;h=d81278ab7922badf984b2d8f177e72353ac224f4;hp=cdc54a1b7afc90ab144842d570600fccaffd9086;hb=84923cc7de2a93c22a2f72daf9ac863959efae13;hpb=3ded6e65b730c2b5eb9a9519448bbcd905c5d7fa diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index cdc54a1..d81278a 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -92,7 +92,7 @@ module Type ( -- Performing substitution on types substTy, substTys, substTyWith, substTheta, - substPred, substTyVar, substTyVarBndr, deShadowTy, lookupTyVar, + substPred, substTyVar, substTyVars, substTyVarBndr, deShadowTy, lookupTyVar, -- Pretty-printing pprType, pprParendType, pprTyThingCategory, pprForAll, @@ -411,7 +411,6 @@ splitNewTyConApp_maybe other = Nothing newTyConInstRhs :: TyCon -> [Type] -> Type newTyConInstRhs tycon tys = let (tvs, ty) = newTyConRhs tycon in substTyWith tvs tys ty - \end{code} @@ -1313,6 +1312,9 @@ substTyVar subst@(TvSubst in_scope env) tv Just ty -> ty -- See Note [Apply Once] } +substTyVars :: TvSubst -> [TyVar] -> [Type] +substTyVars subst tvs = map (substTyVar subst) tvs + lookupTyVar :: TvSubst -> TyVar -> Maybe Type -- See Note [Extending the TvSubst] lookupTyVar (TvSubst in_scope env) tv = lookupVarEnv env tv