[commit: ghc] wip/generalized-arrow: Fix pretty-printer (f4a82ef)

git at git.haskell.org git at git.haskell.org
Mon Mar 21 17:11:31 UTC 2016


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

On branch  : wip/generalized-arrow
Link       : http://ghc.haskell.org/trac/ghc/changeset/f4a82ef1647378634d87cff2b3b7eab8d0954cc2/ghc

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

commit f4a82ef1647378634d87cff2b3b7eab8d0954cc2
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Wed Mar 16 22:07:23 2016 +0100

    Fix pretty-printer


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

f4a82ef1647378634d87cff2b3b7eab8d0954cc2
 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 dd66283..7a2e914 100644
--- a/libraries/base/Data/Typeable/Internal.hs
+++ b/libraries/base/Data/Typeable/Internal.hs
@@ -343,14 +343,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