Commit eaa2e86d authored by simonmar's avatar simonmar

[project @ 2001-08-21 10:03:04 by simonmar]

Another case of parenthesising operator names, this time in a ConDecl.
parent 6e4feb0e
......@@ -611,8 +611,14 @@ instance (Outputable name) => Outputable (ConDecl name) where
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)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment