[commit: ghc] wip/ttypeable: Fix showTypeable (16cdaa1)

git at git.haskell.org git at git.haskell.org
Sat Oct 1 21:35:35 UTC 2016


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

On branch  : wip/ttypeable
Link       : http://ghc.haskell.org/trac/ghc/changeset/16cdaa1734577e8a5663840440e5bbca7a061d2e/ghc

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

commit 16cdaa1734577e8a5663840440e5bbca7a061d2e
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Fri Jul 15 01:00:20 2016 +0200

    Fix showTypeable


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

16cdaa1734577e8a5663840440e5bbca7a061d2e
 libraries/base/Data/Typeable/Internal.hs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs
index 6e5242b..6237d25 100644
--- a/libraries/base/Data/Typeable/Internal.hs
+++ b/libraries/base/Data/Typeable/Internal.hs
@@ -334,7 +334,7 @@ instance Show (TypeRep (a :: k)) where
 
 showTypeable :: Int -> TypeRep (a :: k) -> ShowS
 showTypeable p rep
-  | Just HRefl <- star `eqTypeRep` rep =
+  | Just HRefl <- star `eqTypeRep` typeRepKind rep =
     showTypeable' 9 rep
 
   | otherwise =
@@ -351,14 +351,13 @@ showTypeable' _ rep
     showChar '(' . showArgs (showChar ',') tys . showChar ')'
   where (tc, tys) = splitApps rep
 showTypeable' p (TrTyCon _ tycon _) = showsPrec p tycon
-  --showsPrec p (TRFun x r) =
-  --    showParen (p > 8) $
-  --    showsPrec 9 x . showString " -> " . showsPrec 8 r
+--showTypeable' p (TRFun x r) =
+--      showParen (p > 8) $
+--      showsPrec 9 x . showString " -> " . showsPrec 8 r
 showTypeable' p (TrApp _ (TrApp _ (TrTyCon _ tycon _) x) r)
   | isArrowTyCon tycon =
     showParen (p > 8) $
-    showsPrec 9 x . showString " -> " . showsPrec p r
-
+    showsPrec 9 x . showString " -> " . showsPrec 8 r
 showTypeable' p (TrApp _ f x)
   | otherwise =
     showParen (p > 9) $



More information about the ghc-commits mailing list