summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIavor S. Diatchki <iavor.diatchki@gmail.com>2012-03-18 10:18:24 -0700
committerIavor S. Diatchki <iavor.diatchki@gmail.com>2012-03-18 10:18:24 -0700
commit452e15a94c0d50cd5bef91aa0441e996dc87a21f (patch)
treedfc75746c7a80aa0fc5e3f8575dcdba98da58a98 /compiler
parentc31d0f9c9fd44ba0cf1be17fdb5e9601f5760b20 (diff)
downloadhaskell-452e15a94c0d50cd5bef91aa0441e996dc87a21f.tar.gz
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'.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/iface/IfaceType.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/iface/IfaceType.lhs b/compiler/iface/IfaceType.lhs
index a833d2c218..c4c876d1a7 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