[commit: ghc] master: base: Refactor Show ErrorCall instance into proper ShowS style (302aee5)

git at git.haskell.org git at git.haskell.org
Fri Jan 26 19:41:17 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/302aee52b61b754267c48465e94683f4aeda3fe8/ghc

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

commit 302aee52b61b754267c48465e94683f4aeda3fe8
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Fri Jan 26 13:06:34 2018 -0500

    base: Refactor Show ErrorCall instance into proper ShowS style
    
    Test Plan: Validate
    
    Reviewers: hvr, dfeuer
    
    Reviewed By: dfeuer
    
    Subscribers: dfeuer, rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4304


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

302aee52b61b754267c48465e94683f4aeda3fe8
 libraries/base/GHC/Exception.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs
index d3a6745..37f47a6 100644
--- a/libraries/base/GHC/Exception.hs
+++ b/libraries/base/GHC/Exception.hs
@@ -184,7 +184,8 @@ instance Exception ErrorCall
 -- | @since 4.0.0.0
 instance Show ErrorCall where
   showsPrec _ (ErrorCallWithLocation err "") = showString err
-  showsPrec _ (ErrorCallWithLocation err loc) = showString (err ++ '\n' : loc)
+  showsPrec _ (ErrorCallWithLocation err loc) =
+      showString err . showChar '\n' . showString loc
 
 errorCallException :: String -> SomeException
 errorCallException s = toException (ErrorCall s)



More information about the ghc-commits mailing list