From 9c9e40e59214b1e358c85852218f3a67e712a748 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sun, 28 Mar 2021 14:52:55 +0300 Subject: Replace - with negate It also failed to parse with HLint (I wonder how GHC itself handles it?) --- compiler/GHC/Utils/Misc.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/GHC') 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 = -- cgit v1.2.1