[commit: ghc] master: Don't print roles for data instances (0f7381b)
git at git.haskell.org
git at git.haskell.org
Fri Jan 17 14:07:34 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/0f7381bfb382f9fd7d18ebfc1a436237e6f2e21d/ghc
>---------------------------------------------------------------
commit 0f7381bfb382f9fd7d18ebfc1a436237e6f2e21d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Jan 17 14:06:02 2014 +0000
Don't print roles for data instances
See Trac #8672
>---------------------------------------------------------------
0f7381bfb382f9fd7d18ebfc1a436237e6f2e21d
compiler/main/PprTyThing.hs | 4 +++-
testsuite/tests/ghci/scripts/T5417.stdout | 1 -
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/compiler/main/PprTyThing.hs b/compiler/main/PprTyThing.hs
index c83552b..38b28e9 100644
--- a/compiler/main/PprTyThing.hs
+++ b/compiler/main/PprTyThing.hs
@@ -209,7 +209,9 @@ pprTyCon ss tyCon
pp_roles suppress_if
= sdocWithDynFlags $ \dflags ->
let roles = suppressKinds dflags (tyConKind tyCon) (tyConRoles tyCon)
- in ppUnless (all suppress_if roles) $
+ in ppUnless (isFamInstTyCon tyCon || all suppress_if roles) $
+ -- Don't display roles for data family instances (yet)
+ -- See discussion on Trac #8672.
ptext (sLit "type role") <+> ppr tyCon <+> hsep (map ppr roles)
pp_tc_with_kind = vcat [ pp_roles (const True)
diff --git a/testsuite/tests/ghci/scripts/T5417.stdout b/testsuite/tests/ghci/scripts/T5417.stdout
index 2cf0826..73d1de9 100644
--- a/testsuite/tests/ghci/scripts/T5417.stdout
+++ b/testsuite/tests/ghci/scripts/T5417.stdout
@@ -1,5 +1,4 @@
data B1 a = B1 a
-type role T5417.R:FB1 nominal
data instance C.F (B1 a) = B2 a
type role D nominal
data family D a
More information about the ghc-commits
mailing list