summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2021-03-28 14:52:55 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-28 17:27:49 -0400
commit9c9e40e59214b1e358c85852218f3a67e712a748 (patch)
tree7ca95cfbba35f7ad68c9ff979794fb6781d16df0
parent9594f6f64f790ea1f154de42d1de0fbdf67a38ba (diff)
downloadhaskell-9c9e40e59214b1e358c85852218f3a67e712a748.tar.gz
Replace - with negate
It also failed to parse with HLint (I wonder how GHC itself handles it?)
-rw-r--r--compiler/GHC/Utils/Misc.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Utils/Misc.hs b/compiler/GHC/Utils/Misc.hs
index abd85b6b66..96dce36f94 100644
--- a/compiler/GHC/Utils/Misc.hs
+++ b/compiler/GHC/Utils/Misc.hs
@@ -1181,7 +1181,7 @@ readRational__ r = do
readRational :: String -> Rational -- NB: *does* handle a leading "-"
readRational top_s
= case top_s of
- '-' : xs -> - (read_me xs)
+ '-' : xs -> negate (read_me xs)
xs -> read_me xs
where
read_me s
@@ -1254,7 +1254,7 @@ readSignificandExponentPair top_s
readHexRational :: String -> Rational
readHexRational str =
case str of
- '-' : xs -> - (readMe xs)
+ '-' : xs -> negate (readMe xs)
xs -> readMe xs
where
readMe as =