ppr_con_details con (InfixCon ty1 ty2)
= hsep [ppr_bang ty1, ppr con, ppr_bang ty2]
+-- ConDecls generated by MkIface.ifaceTyCls always have a VanillaCon, even
+-- if the constructor is an infix one. This is because in an interface file
+-- we don't distinguish between the two. Hence when printing these for the
+-- user, we need to parenthesise infix constructor names.
ppr_con_details con (VanillaCon tys)
- = ppr con <+> hsep (map (ppr_bang) tys)
+ = getPprStyle $ \ sty ->
+ hsep ((if ifaceStyle sty then ppr con else ppr_var con)
+ : map (ppr_bang) tys)
ppr_con_details con (RecCon fields)
= ppr con <+> braces (sep (punctuate comma (map ppr_field fields)))