From f6ee56796bde1970196a2e3bf6ba303e3f7ed2b4 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 2 Feb 2008 21:39:36 +0000 Subject: [PATCH] Whitespace only --- compiler/types/Type.lhs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/compiler/types/Type.lhs b/compiler/types/Type.lhs index 92ff2bc..9561c19 100644 --- a/compiler/types/Type.lhs +++ b/compiler/types/Type.lhs @@ -1398,21 +1398,22 @@ subst_ty :: TvSubst -> Type -> Type subst_ty subst ty = go ty where - go (TyVarTy tv) = substTyVar subst tv - go (TyConApp tc tys) = let args = map go tys - in args `seqList` TyConApp tc args - - go (PredTy p) = PredTy $! (substPred subst p) - - go (NoteTy (FTVNote _) ty2) = go ty2 -- Discard the free tyvar note - - go (FunTy arg res) = (FunTy $! (go arg)) $! (go res) - go (AppTy fun arg) = mkAppTy (go fun) $! (go arg) - -- The mkAppTy smart constructor is important - -- we might be replacing (a Int), represented with App - -- by [Int], represented with TyConApp - go (ForAllTy tv ty) = case substTyVarBndr subst tv of - (subst', tv') -> ForAllTy tv' $! (subst_ty subst' ty) + go (TyVarTy tv) = substTyVar subst tv + go (TyConApp tc tys) = let args = map go tys + in args `seqList` TyConApp tc args + + go (PredTy p) = PredTy $! (substPred subst p) + + go (NoteTy (FTVNote _) ty2) = go ty2 -- Discard the free tyvar note + + go (FunTy arg res) = (FunTy $! (go arg)) $! (go res) + go (AppTy fun arg) = mkAppTy (go fun) $! (go arg) + -- The mkAppTy smart constructor is important + -- we might be replacing (a Int), represented with App + -- by [Int], represented with TyConApp + go (ForAllTy tv ty) = case substTyVarBndr subst tv of + (subst', tv') -> + ForAllTy tv' $! (subst_ty subst' ty) substTyVar :: TvSubst -> TyVar -> Type substTyVar subst@(TvSubst _ _) tv -- 1.7.10.4