[project @ 2005-03-08 09:45:45 by simonpj]
authorsimonpj <unknown>
Tue, 8 Mar 2005 09:45:45 +0000 (09:45 +0000)
committersimonpj <unknown>
Tue, 8 Mar 2005 09:45:45 +0000 (09:45 +0000)
Better printing of types; merge please

ghc/compiler/iface/IfaceType.lhs

index f893a58..9853a04 100644 (file)
@@ -307,10 +307,13 @@ instance Outputable IfaceTyCon where
 -------------------
 pprIfaceContext :: IfaceContext -> SDoc
 -- Prints "(C a, D b) =>", including the arrow
-pprIfaceContext []    = empty
-pprIfaceContext theta = parens (sep (punctuate comma (map ppr theta))) 
-                       <+> ptext SLIT("=>")
-  
+pprIfaceContext []     = empty
+pprIfaceContext theta = ppr_preds theta <+> ptext SLIT("=>")
+
+ppr_preds [pred] = ppr pred    -- No parens
+ppr_preds preds  = parens (sep (punctuate comma (map ppr preds))) 
+                        
+-------------------
 pabrackets p = ptext SLIT("[:") <> p <> ptext SLIT(":]")
 \end{code}