summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-01-26 13:06:34 -0500
committerBen Gamari <ben@smart-cactus.org>2018-01-26 14:37:28 -0500
commit302aee52b61b754267c48465e94683f4aeda3fe8 (patch)
tree0f9920c333f07d2d007f73ff2c4ec9c176e7c043
parent66961dc85e39bbc43a1c065ee00c381a7ee579e1 (diff)
downloadhaskell-302aee52b61b754267c48465e94683f4aeda3fe8.tar.gz
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
-rw-r--r--libraries/base/GHC/Exception.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs
index d3a6745fa5..37f47a6123 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)