[Git][ghc/ghc][master] Make the current `base` buildable with GHC 10.0
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: f4399dd1 by Wolfgang Jeltsch at 2026-05-20T04:50:37-04:00 Make the current `base` buildable with GHC 10.0 - - - - - 5 changed files: - libraries/base/src/Data/Data.hs - libraries/base/src/Data/Version.hs - libraries/base/src/GHC/ByteOrder.hs - libraries/base/src/Numeric.hs - libraries/base/src/System/IO.hs Changes: ===================================== libraries/base/src/Data/Data.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} -- | @@ -100,6 +102,8 @@ module Data.Data ( import GHC.Internal.Data.Data import Data.Typeable +#if __GLASGOW_HASKELL__ >= 1001 + import GHC.Real (toRational) import GHC.Float (Double) import Data.Eq ((==)) @@ -134,3 +138,5 @@ readConstr dt str = ffloat :: Double -> Constr ffloat = mkPrimCon dt str . FloatConstr . toRational + +#endif ===================================== libraries/base/src/Data/Version.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# LANGUAGE StandaloneDeriving #-} @@ -38,6 +40,8 @@ module Data.Version ( import GHC.Internal.Data.Version +#if __GLASGOW_HASKELL__ >= 1001 + import Control.Applicative (pure, (*>)) import Data.Functor (fmap) import Data.Char (isDigit, isAlphaNum) @@ -59,3 +63,5 @@ parseVersion :: ReadP Version parseVersion = do branch <- sepBy1 (fmap read (munch1 isDigit)) (char '.') tags <- many (char '-' *> munch1 isAlphaNum) pure (Version branch tags) + +#endif ===================================== libraries/base/src/GHC/ByteOrder.hs ===================================== @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + {-# LANGUAGE Safe #-} {-# LANGUAGE StandaloneDeriving #-} @@ -25,6 +27,8 @@ module GHC.ByteOrder import GHC.Internal.ByteOrder +#if __GLASGOW_HASKELL__ >= 1001 + import Text.Read {-NOTE: @@ -35,3 +39,5 @@ import Text.Read -- | @since base-4.11.0.0 deriving instance Read ByteOrder + +#endif ===================================== libraries/base/src/Numeric.hs ===================================== @@ -1,4 +1,11 @@ +{-# LANGUAGE CPP #-} + +#if __GLASGOW_HASKELL__ >= 1001 {-# LANGUAGE Trustworthy #-} +#else +{-# LANGUAGE Safe #-} +#endif + {-# LANGUAGE MagicHash #-} {-# LANGUAGE ImportQualifiedPost #-} @@ -51,6 +58,8 @@ module Numeric import GHC.Internal.Numeric +#if __GLASGOW_HASKELL__ >= 1001 + import GHC.Types (Char (C#)) import GHC.Err (error, errorWithoutStackTrace) import GHC.Base (unsafeChr) @@ -326,3 +335,5 @@ showOct = showIntAtBase 8 intToDigit -- | Show /non-negative/ 'Integral' numbers in base 2. showBin :: Integral a => a -> ShowS showBin = showIntAtBase 2 intToDigit + +#endif ===================================== libraries/base/src/System/IO.hs ===================================== @@ -899,6 +899,8 @@ rw_flags = output_flags .|. o_RDWR -- > input^D -- output +#if __GLASGOW_HASKELL__ >= 1001 + {-NOTE: The following instances are technically orphans, but practically they are not, since ordinary users should not use @ghc-internal@ directly and thus @@ -919,3 +921,5 @@ deriving instance Read Newline -- | @since base-4.3.0.0 deriving instance Read NewlineMode + +#endif View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f4399dd1e2b6abe93ed1d4b30022d637... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f4399dd1e2b6abe93ed1d4b30022d637... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)