Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : type-nats

http://hackage.haskell.org/trac/ghc/changeset/452e15a94c0d50cd5bef91aa0441e996dc87a21f

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

commit 452e15a94c0d50cd5bef91aa0441e996dc87a21f
Author: Iavor S. Diatchki <[email protected]>
Date:   Sun Mar 18 10:18:24 2012 -0700

    Fix the printing of * (the kind).
    
    Type and kinds use the same printing code, but the kind * is not
    an infix operator and so it should not be wrapped in parens.
    
    As is, 'parenSymOcc', can't get this right because it does not know
    if it is looking at *, the type, or *, the kind.   This is why I
    added a special case in 'ppr_tc'.

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

 compiler/iface/IfaceType.lhs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/compiler/iface/IfaceType.lhs b/compiler/iface/IfaceType.lhs
index a833d2c..c4c876d 100644
--- a/compiler/iface/IfaceType.lhs
+++ b/compiler/iface/IfaceType.lhs
@@ -263,7 +263,11 @@ ppr_tc_app ctxt_prec tc tys
 
 ppr_tc :: IfaceTyCon -> SDoc
 -- Wrap infix type constructors in parens
-ppr_tc tc = parenSymOcc (getOccName (ifaceTyConName tc)) (ppr tc)
+ppr_tc tc = wrap (ifaceTyConName tc) (ppr tc)
+  where
+  -- The kind * does not get wrapped in parens.
+  wrap name | name == liftedTypeKindTyConName = id
+  wrap name                                   = parenSymOcc (getOccName name)
 
 ppr_tylit :: IfaceTyLit -> SDoc
 ppr_tylit (IfaceNumTyLit n) = integer n



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to