Pretty printing of `HsCase`
At the moment an HsCase
expression is printed via
ppr_expr (HsCase _ expr matches@(MG { mg_alts = L _ [_] }))
= sep [ sep [text "case", nest 4 (ppr expr), ptext (sLit "of {")],
nest 2 (pprMatches matches) <+> char '}']
ppr_expr (HsCase _ expr matches)
= sep [ sep [text "case", nest 4 (ppr expr), ptext (sLit "of")],
nest 2 (pprMatches matches) ]
Because of the underscore in [_]
, the first version always matches, and every HsCase
expression has the alts wrapped in braces.
Is this intentional? It would seem that either braces can be dispensed with completely, or the first one should match on the empty list, so we end up with the empty alternates case as case x of { }
.