More compact Outputable instance for `Uniq(D)Set`
authorSebastian Graf <sebastian.graf@kit.edu>
Sat, 17 Nov 2018 11:31:29 +0000 (12:31 +0100)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Sat, 17 Nov 2018 12:52:26 +0000 (13:52 +0100)
commit17e771e17e2374f50f39948955e583760f28351f
tree7727dae3ef97ceb964b74011f8ff295ca0546fa6
parent5bf07866fe34a5b7eb27870ec73a9f44e1c9c37e
More compact Outputable instance for `Uniq(D)Set`

Summary:
Until now, `UniqSet` and `UniqDSet` inherited their `Outputable`
instances from `UniqFM` and `UniqDFM`.

That made for verbose and redundant output. This patch rectifies
that by pretty-printing these sets in common math notation.
E.g., previously, we would render `UniqSet`s like this:

    [s2fE :-> x_s2fE, s2fF :-> y_s2fF, s2fG :-> z_s2fG, s2fH :-> g_s2fH]

Now, they're are printed like this:

    {x_s2fE, y_s2fF, z_s2fG, g_s2fH}

Reviewers: simonpj, bgamari, AndreasK, dfeuer, osa1

Reviewed By: osa1

Subscribers: osa1, rwbarton, carter

GHC Trac Issues: #15879

Differential Revision: https://phabricator.haskell.org/D5315
compiler/utils/UniqDSet.hs
compiler/utils/UniqSet.hs