[commit: ghc] master: Improve pretty-printing in pprIfaceIdBndr (e7f22bf)

git at git.haskell.org git at git.haskell.org
Thu Dec 17 12:29:22 UTC 2015


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

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

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

commit e7f22bfb70d82dc92eb5ac5579d763e1a1f5522d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Dec 14 13:34:26 2015 +0000

    Improve pretty-printing in pprIfaceIdBndr
    
    In particular, add parnes when we need an explicit type.


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

e7f22bfb70d82dc92eb5ac5579d763e1a1f5522d
 compiler/iface/IfaceType.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs
index f744f81..640d104 100644
--- a/compiler/iface/IfaceType.hs
+++ b/compiler/iface/IfaceType.hs
@@ -565,7 +565,7 @@ pprIfaceLamBndr (b, IfaceNoOneShot) = ppr b
 pprIfaceLamBndr (b, IfaceOneShot)   = ppr b <> text "[OneShot]"
 
 pprIfaceIdBndr :: (IfLclName, IfaceType) -> SDoc
-pprIfaceIdBndr (name, ty) = hsep [ppr name, dcolon, ppr ty]
+pprIfaceIdBndr (name, ty) = parens (ppr name <+> dcolon <+> ppr ty)
 
 pprIfaceTvBndr :: IfaceTvBndr -> SDoc
 pprIfaceTvBndr (tv, IfaceTyConApp tc ITC_Nil)



More information about the ghc-commits mailing list