From 5451c8660e859c595ee903252c38c2044a7af06e Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 18 Jun 2002 08:05:44 +0000 Subject: [PATCH] [project @ 2002-06-18 08:05:44 by simonpj] Wibble on printing outmost parens --- ghc/compiler/hsSyn/HsTypes.lhs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/hsSyn/HsTypes.lhs b/ghc/compiler/hsSyn/HsTypes.lhs index 9cbfbcb..d7a2b0b 100644 --- a/ghc/compiler/hsSyn/HsTypes.lhs +++ b/ghc/compiler/hsSyn/HsTypes.lhs @@ -302,9 +302,13 @@ maybeParen ctxt_prec op_prec p | ctxt_prec >= op_prec = parens p pprHsType, pprParendHsType :: (Outputable name) => HsType name -> SDoc -pprHsType ty = ppr_mono_ty pREC_TOP ty +pprHsType ty = ppr_mono_ty pREC_TOP (de_paren ty) pprParendHsType ty = ppr_mono_ty pREC_CON ty +-- Remove outermost HsParTy parens before printing a type +de_paren (HsParTy ty) = de_paren ty +de_paren ty = ty + ppr_mono_ty ctxt_prec (HsForAllTy maybe_tvs ctxt ty) = maybeParen ctxt_prec pREC_FUN $ sep [pp_header, pprHsType ty] -- 1.7.10.4