summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
44c2d76)
Wibble on printing outmost parens
pprHsType, pprParendHsType :: (Outputable name) => HsType name -> SDoc
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
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]
ppr_mono_ty ctxt_prec (HsForAllTy maybe_tvs ctxt ty)
= maybeParen ctxt_prec pREC_FUN $
sep [pp_header, pprHsType ty]