From: simonpj Date: Tue, 18 Jun 2002 08:05:44 +0000 (+0000) Subject: [project @ 2002-06-18 08:05:44 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1955 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5451c8660e859c595ee903252c38c2044a7af06e;p=ghc-hetmet.git [project @ 2002-06-18 08:05:44 by simonpj] Wibble on printing outmost parens --- 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]