[project @ 2002-09-16 11:24:36 by simonpj]
authorsimonpj <unknown>
Mon, 16 Sep 2002 11:24:36 +0000 (11:24 +0000)
committersimonpj <unknown>
Mon, 16 Sep 2002 11:24:36 +0000 (11:24 +0000)
Fix bug in Read instance for Maybe

GHC/Read.lhs

index 68d0521..ad875c0 100644 (file)
@@ -326,14 +326,13 @@ parenthesis-like objects such as (...) and [...] can be an argument to
 instance Read a => Read (Maybe a) where
   readPrec =
     parens
-    ( prec appPrec
-      ( do L.Ident "Nothing" <- lexP
-           return Nothing
-       +++
-        do L.Ident "Just" <- lexP
-           x            <- step readPrec
-           return (Just x)
-      )
+    (do L.Ident "Nothing" <- lexP
+        return Nothing
+     +++
+     prec appPrec (
+       do L.Ident "Just" <- lexP
+           x              <- step readPrec
+           return (Just x))
     )
 
   readListPrec = readListPrecDefault