-pprConArgs (RecCon rpats) = braces (hsep (punctuate comma (map (pp_rpat) rpats)))
- where
- pp_rpat (HsRecField v p _d) =
- hsep [ppr v, char '=', ppr p]
+pprConArgs (RecCon rpats) = ppr rpats
+
+instance (OutputableBndr id, Outputable arg)
+ => Outputable (HsRecFields id arg) where
+ ppr (HsRecFields { rec_flds = flds, rec_dotdot = Nothing })
+ = braces (fsep (punctuate comma (map ppr flds)))
+ ppr (HsRecFields { rec_flds = flds, rec_dotdot = Just n })
+ = braces (fsep (punctuate comma (map ppr (take n flds) ++ [dotdot])))
+ where
+ dotdot = ptext SLIT("..") <+> ifPprDebug (ppr (drop n flds))
+
+instance (OutputableBndr id, Outputable arg)
+ => Outputable (HsRecField id arg) where
+ ppr (HsRecField { hsRecFieldId = f, hsRecFieldArg = arg,
+ hsRecPun = pun })
+ = ppr f <+> (if pun then empty else equals <+> ppr arg)