[commit: ghc] master: Improve pretty-printing of Avail (bb84ee4)

git at git.haskell.org git at git.haskell.org
Fri Jun 24 10:00:49 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/bb84ee44e30eeedce37ce6b09684747e2c659836/ghc

>---------------------------------------------------------------

commit bb84ee44e30eeedce37ce6b09684747e2c659836
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jun 24 09:03:01 2016 +0100

    Improve pretty-printing of Avail


>---------------------------------------------------------------

bb84ee44e30eeedce37ce6b09684747e2c659836
 compiler/basicTypes/Avail.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/basicTypes/Avail.hs b/compiler/basicTypes/Avail.hs
index 9595abc..4dc6cb6 100644
--- a/compiler/basicTypes/Avail.hs
+++ b/compiler/basicTypes/Avail.hs
@@ -171,8 +171,11 @@ instance Outputable AvailInfo where
    ppr = pprAvail
 
 pprAvail :: AvailInfo -> SDoc
-pprAvail (Avail _ n)         = ppr n
-pprAvail (AvailTC n ns fs) = ppr n <> braces (hsep (punctuate comma (map ppr ns ++ map (ppr . flLabel) fs)))
+pprAvail (Avail _ n)
+  = ppr n
+pprAvail (AvailTC n ns fs)
+  = ppr n <> braces (sep [ fsep (punctuate comma (map ppr ns)) <> semi
+                         , fsep (punctuate comma (map (ppr . flLabel) fs))])
 
 instance Binary AvailInfo where
     put_ bh (Avail b aa) = do



More information about the ghc-commits mailing list