From 121ce7763715e6c58b55afc09536256a3c83f04e Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Sun, 27 Jul 1997 09:14:11 +0000
Subject: [PATCH] [project @ 1997-07-27 09:14:11 by sof] Use readRational__
 rather than readRational (it copes with leading -)

---
 ghc/compiler/reader/ReadPrefix.lhs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ghc/compiler/reader/ReadPrefix.lhs b/ghc/compiler/reader/ReadPrefix.lhs
index 18ec5b610e6e..d16dc74ff068 100644
--- a/ghc/compiler/reader/ReadPrefix.lhs
+++ b/ghc/compiler/reader/ReadPrefix.lhs
@@ -512,8 +512,11 @@ wlkLiteral ulit
     as_integer s  = readInteger (_UNPK_ s)
 #if __GLASGOW_HASKELL__ == 201
     as_rational s = GHCbase.readRational__ (_UNPK_ s) -- non-std
-#elif __GLASGOW_HASKELL__ >= 202
-    as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a } -- ToDo, use non-std readRational__
+#elif __GLASGOW_HASKELL__ == 202
+    as_rational s = case readRational (_UNPK_ s) of { [(a,_)] -> a }
+#elif __GLASGOW_HASKELL__ >= 203
+    as_rational s = readRational__ (_UNPK_ s) -- use non-std readRational__ 
+					      -- to handle rationals with leading '-'
 #else
     as_rational s = _readRational (_UNPK_ s) -- non-std
 #endif
-- 
GitLab