X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypes%2FTypeRep.lhs;h=5c29087ec989e644f8af3224fe1fcd45301f63a3;hb=524c609b6d8d220b03640dc71a209530bf2ed280;hp=f71606e39b7a59d0aef4d7e5518004f72c81238c;hpb=3256860dc70f3a4fbd953c858ec500d70a9be820;p=ghc-hetmet.git diff --git a/compiler/types/TypeRep.lhs b/compiler/types/TypeRep.lhs index f71606e..5c29087 100644 --- a/compiler/types/TypeRep.lhs +++ b/compiler/types/TypeRep.lhs @@ -15,7 +15,7 @@ module TypeRep ( Kind, ThetaType, -- Synonyms - funTyCon, + funTyCon, funTyConName, -- Pretty-printing pprType, pprParendType, pprTypeApp, @@ -53,7 +53,6 @@ import {-# SOURCE #-} DataCon( DataCon, dataConName ) -- friends: import Var import Name -import OccName import BasicTypes import TyCon import Class @@ -432,7 +431,14 @@ pprTypeApp tc tys = ppr_type_app TopPrec (getName tc) tys pprPred :: PredType -> SDoc pprPred (ClassP cls tys) = pprClassPred cls tys pprPred (IParam ip ty) = ppr ip <> dcolon <> pprType ty -pprPred (EqPred ty1 ty2) = sep [ppr ty1, nest 2 (ptext (sLit "~")), ppr ty2] +pprPred (EqPred ty1 ty2) = sep [ ppr_type FunPrec ty1 + , nest 2 (ptext (sLit "~")) + , ppr_type FunPrec ty2] + -- Precedence looks like (->) so that we get + -- Maybe a ~ Bool + -- (a->a) ~ Bool + -- Note parens on the latter! + pprClassPred :: Class -> [Type] -> SDoc pprClassPred clas tys = ppr_type_app TopPrec (getName clas) tys