[commit: ghc] wip/ttypeable: Fix pretty-printer (8ff0010)
git at git.haskell.org
git at git.haskell.org
Sat Oct 1 21:34:41 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/ttypeable
Link : http://ghc.haskell.org/trac/ghc/changeset/8ff0010ef16f81cf8ac39548f3e90948bb661940/ghc
>---------------------------------------------------------------
commit 8ff0010ef16f81cf8ac39548f3e90948bb661940
Author: Ben Gamari <ben at smart-cactus.org>
Date: Wed Mar 16 22:07:23 2016 +0100
Fix pretty-printer
>---------------------------------------------------------------
8ff0010ef16f81cf8ac39548f3e90948bb661940
libraries/base/Data/Typeable/Internal.hs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs
index d879905..a2431ac 100644
--- a/libraries/base/Data/Typeable/Internal.hs
+++ b/libraries/base/Data/Typeable/Internal.hs
@@ -347,14 +347,18 @@ instance Show (TypeRep (a :: k)) where
showChar '(' . showArgs (showChar ',') tys . showChar ')'
where (tc, tys) = splitApps rep
showsPrec p (TrTyCon _ tycon _) = showsPrec p tycon
- showsPrec _ (TrApp _ (TrTyCon _ tycon _) x)
+ --showsPrec p (TRFun x r) =
+ -- showParen (p > 8) $
+ -- showsPrec 9 x . showString " -> " . showsPrec 8 r
+ showsPrec p (TrApp _ (TrApp _ (TrTyCon _ tycon _) x) r)
| isArrowTyCon tycon =
- shows x . showString " ->"
+ showParen (p > 8) $
+ showsPrec 9 x . showString " -> " . showsPrec p r
showsPrec p (TrApp _ f x)
| otherwise =
showParen (p > 9) $
- showsPrec p f .
+ showsPrec 8 f .
space .
showsPrec 9 x
where
More information about the ghc-commits
mailing list