From 0e73a9fbdc8555ffb948cfd72401a700b122c395 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Wed, 16 Dec 2009 08:45:13 +0000 Subject: [PATCH] Fix a long-standing infelicity in the type pretty printer We weren't parenthesising List (C Int) correctly, when (C Int) is a PredTy --- compiler/types/TypeRep.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/types/TypeRep.lhs b/compiler/types/TypeRep.lhs index a5176ce..1660267 100644 --- a/compiler/types/TypeRep.lhs +++ b/compiler/types/TypeRep.lhs @@ -471,7 +471,8 @@ ppr_type :: Prec -> Type -> SDoc ppr_type _ (TyVarTy tv) -- Note [Infix type variables] | isSymOcc (getOccName tv) = parens (ppr tv) | otherwise = ppr tv -ppr_type _ (PredTy pred) = ifPprDebug (ptext (sLit "")) <> (ppr pred) +ppr_type p (PredTy pred) = maybeParen p TyConPrec $ + ifPprDebug (ptext (sLit "")) <> (ppr pred) ppr_type p (TyConApp tc tys) = ppr_tc_app p tc tys ppr_type p (AppTy t1 t2) = maybeParen p TyConPrec $ -- 1.7.10.4