From dbaf61e7fe3de11aa10e8dd62341888e497f0b39 Mon Sep 17 00:00:00 2001 From: David Waern Date: Sat, 8 Dec 2007 16:26:12 +0000 Subject: Use ppParendType when printing types args in predicates --- src/Haddock/Backends/Html.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Haddock') diff --git a/src/Haddock/Backends/Html.hs b/src/Haddock/Backends/Html.hs index 8c6a82db..f00a8f04 100644 --- a/src/Haddock/Backends/Html.hs +++ b/src/Haddock/Backends/Html.hs @@ -775,13 +775,13 @@ ppLPred = ppPred . unLoc ppPred (HsClassP n ts) - | classOp, length ts > 2 = firstApp <+> ppLTypes rest + | classOp, length ts > 2 = firstApp <+> ppLParendTypes rest | classOp = firstApp - | otherwise = ppDocName n <+> ppLTypes ts + | otherwise = ppDocName n <+> ppLParendTypes ts where - classOp = isNameConSym . getName $ n + classOp = isNameConSym . getName $ n t1:t2:rest = ts - firstApp = ppLType t1 <+> ppDocName n <+> ppLType t2 + firstApp = ppLParendType t1 <+> ppDocName n <+> ppLParendType t2 -- TODO: find out what happened to the Dupable/Linear distinction @@ -1237,6 +1237,7 @@ ppLParendType = ppParendType . unLoc ppType ty = ppr_mono_ty pREC_TOP (prepare ty) ppParendType ty = ppr_mono_ty pREC_CON ty + -- Before printing a type -- (a) Remove outermost HsParTy parens -- (b) Drop top-level for-all type variables in user style -- cgit v1.2.3