From 35c63bfcf979854cbe034a134dbcb7505313bbef Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 7 Feb 2002 12:50:47 +0000 Subject: [PATCH] [project @ 2002-02-07 12:50:00 by simonpj] Better pretty printing --- ghc/compiler/typecheck/Inst.lhs | 4 ++-- ghc/compiler/typecheck/TcSimplify.lhs | 2 +- ghc/compiler/types/PprType.lhs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/typecheck/Inst.lhs b/ghc/compiler/typecheck/Inst.lhs index 23eab62..64889ef 100644 --- a/ghc/compiler/typecheck/Inst.lhs +++ b/ghc/compiler/typecheck/Inst.lhs @@ -61,7 +61,7 @@ import Class ( Class ) import Id ( Id, idName, idType, mkUserLocal, mkSysLocal, mkLocalId, setIdUnique ) import PrelInfo ( isStandardClass, isCcallishClass, isNoDictClass ) import Name ( Name, mkMethodOcc, getOccName ) -import PprType ( pprPred ) +import PprType ( pprPred, pprParendType ) import Subst ( emptyInScopeSet, mkSubst, substTy, substTyWith, substTheta, mkTyVarSubst, mkTopTyVarSubst ) @@ -551,7 +551,7 @@ pprInst (Dict u pred loc) = pprPred pred <+> show_uniq u pprInst m@(Method u id tys theta tau loc) = hsep [ppr id, ptext SLIT("at"), - brackets (interppSP tys) {- , + brackets (sep (map pprParendType tys)) {- , ptext SLIT("theta"), ppr theta, ptext SLIT("tau"), ppr tau show_uniq u, diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs index 9b49a02..ca9180f 100644 --- a/ghc/compiler/typecheck/TcSimplify.lhs +++ b/ghc/compiler/typecheck/TcSimplify.lhs @@ -1059,7 +1059,7 @@ data Avail -- is turned into an LinRhss [TcExpr] -- A supply of suitable RHSs -pprAvails avails = vcat [ppr inst <+> equals <+> pprAvail avail +pprAvails avails = vcat [sep [ppr inst, nest 2 (equals <+> pprAvail avail)] | (inst,avail) <- fmToList avails ] instance Outputable Avail where diff --git a/ghc/compiler/types/PprType.lhs b/ghc/compiler/types/PprType.lhs index 0412c04..0285731 100644 --- a/ghc/compiler/types/PprType.lhs +++ b/ghc/compiler/types/PprType.lhs @@ -70,13 +70,13 @@ pprPred = pprSourceType pprSourceType :: SourceType -> SDoc pprSourceType (ClassP clas tys) = pprClassPred clas tys pprSourceType (IParam n ty) = hsep [ppr n, dcolon, ppr ty] -pprSourceType (NType tc tys) = ppr tc <+> hsep (map pprParendType tys) +pprSourceType (NType tc tys) = ppr tc <+> sep (map pprParendType tys) pprClassPred :: Class -> [Type] -> SDoc -pprClassPred clas tys = ppr clas <+> hsep (map pprParendType tys) +pprClassPred clas tys = ppr clas <+> sep (map pprParendType tys) pprTheta :: ThetaType -> SDoc -pprTheta theta = parens (hsep (punctuate comma (map pprPred theta))) +pprTheta theta = parens (sep (punctuate comma (map pprPred theta))) instance Outputable Type where ppr ty = pprType ty -- 1.7.10.4