shithub: MicroHs

Download patch

ref: d17977027b1ba039d0b78791d4a1ffe7017d73e1
parent: d18028534694138958729d3b2db87bb126db3b65
author: Lennart Augustsson <lennart@augustsson.net>
date: Sat Sep 21 09:34:53 EDT 2024

Use correct Natural

--- a/lib/Numeric/Natural.hs
+++ b/lib/Numeric/Natural.hs
@@ -2,6 +2,9 @@
   ( Natural
   , minusNaturalMaybe
   ) where
+import Prelude(); import MiniPrelude
+import Data.Integer
+import Data.Real
 import Control.Exception
 
 newtype Natural = N Integer
--- a/lib/Text/Read/Internal.hs
+++ b/lib/Text/Read/Internal.hs
@@ -70,6 +70,7 @@
 import Data.String
 import Data.Tuple
 import Data.Word
+import Numeric.Natural
 import qualified Text.ParserCombinators.ReadP as P
 import Text.ParserCombinators.ReadP(ReadS, readP_to_S)
 import Text.ParserCombinators.ReadPrec
@@ -76,9 +77,6 @@
 import qualified Text.Read.Lex as L
 import Text.Show(appPrec)
 
--- XXX
-type Natural = Integer
-
 ratioPrec :: Int
 ratioPrec = 7
 
@@ -635,12 +633,12 @@
   readListPrec = readListPrecDefault
   readList     = readListDefault
 
-{-
 -- | @since base-4.8.0.0
 instance Read Natural where
   readsPrec d = map (\(n, s) -> (fromInteger n, s))
                   . filter ((>= 0) . (\(x,_)->x)) . readsPrec d
--}
+  readListPrec = readListPrecDefault
+  readList     = readListDefault
 
 -- | @since base-2.01
 instance Read Float where
--