Commit 35c63bfc authored by simonpj's avatar simonpj
Browse files

[project @ 2002-02-07 12:50:00 by simonpj]

Better pretty printing
parent 54bab78d
......@@ -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,
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment