[Git][ghc/ghc][master] Remove bitSize from MINIMAL pragma of class Bits
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 1d2a26ee by Andrew Lelechenko at 2026-10-01T20:22:04-04:00 Remove bitSize from MINIMAL pragma of class Bits Cf. https://github.com/haskell/core-libraries-committee/issues/441 The function is deprecated for 12 years and has a default implementation, yet it was never removed from the MINIMAL pragma, putting library authors in a very awkward position. Let's finally remove bitSize from MINIMAL. - - - - - 5 changed files: - libraries/base/changelog.md - libraries/ghc-internal/src/GHC/Internal/Bits.hs - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 Changes: ===================================== libraries/base/changelog.md ===================================== @@ -7,6 +7,7 @@ * Add `Data.List.NonEmpty.{zip{3..7},zipWith{3..7},unzip{3..7}}` ([CLC proposal #409)(https://github.com/haskell/core-libraries-committee/issues/409)) * Ensure that `Data.List.elem` and `notElem` can be specialized even when no list fusion happens. ([CLC proposal #412)(https://github.com/haskell/core-libraries-committee/issues/412)) * Introduce `Data.Double` and `Data.Float` modules. ([CLC proposal #378](https://github.com/haskell/core-libraries-committee/issues/378)) + * Remove `bitSize` from `MINIMAL` pragma of `class Bits`. ([CLC proposal #440](https://github.com/haskell/core-libraries-committee/issues/440)) * Change `Generically a`'s `Monoid` definition to require a `Semigroup` constraint, and define its `mconcat` using `(<>)` from that constraint. ([CLC proposal #413](https://github.com/haskell/core-libraries-committee/issues/413)) * Add `withEmptyCallStack` to `GHC.Stack`. ([CLC proposal #428](https://github.com/haskell/core-libraries-committee/issues/428)) * Add new `Data.RealFloat` module re-exporting `RealFloat` from `GHC.Float` ([CLC proposal #394](https://github.com/haskell/core-libraries-committee/issues/394)) ===================================== libraries/ghc-internal/src/GHC/Internal/Bits.hs ===================================== @@ -90,7 +90,7 @@ class Eq a => Bits a where {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), - bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + bitSizeMaybe, isSigned, testBit, bit, popCount #-} -- | Bitwise \"and\" (.&.) :: a -> a -> a ===================================== testsuite/tests/interface-stability/base-exports.stdout ===================================== @@ -726,7 +726,7 @@ module Data.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int @@ -2024,7 +2024,7 @@ module Foreign where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -2938,7 +2938,7 @@ module Foreign.Safe where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -5070,7 +5070,7 @@ module GHC.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int ===================================== testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs ===================================== @@ -726,7 +726,7 @@ module Data.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int @@ -2024,7 +2024,7 @@ module Foreign where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -2938,7 +2938,7 @@ module Foreign.Safe where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -5070,7 +5070,7 @@ module GHC.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int ===================================== testsuite/tests/interface-stability/base-exports.stdout-mingw32 ===================================== @@ -726,7 +726,7 @@ module Data.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int @@ -2024,7 +2024,7 @@ module Foreign where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -2938,7 +2938,7 @@ module Foreign.Safe where rotateL :: a -> Int -> a rotateR :: a -> Int -> a popCount :: a -> Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FinalizerEnvPtr :: * -> * -> * type FinalizerEnvPtr env a = FunPtr (Ptr env -> Ptr a -> GHC.Internal.Types.IO ()) type FinalizerPtr :: * -> * @@ -5073,7 +5073,7 @@ module GHC.Bits where rotateL :: a -> GHC.Internal.Types.Int -> a rotateR :: a -> GHC.Internal.Types.Int -> a popCount :: a -> GHC.Internal.Types.Int - {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSize, bitSizeMaybe, isSigned, testBit, bit, popCount #-} + {-# MINIMAL (.&.), (.|.), xor, complement, (shift | (shiftL, shiftR)), (rotate | (rotateL, rotateR)), bitSizeMaybe, isSigned, testBit, bit, popCount #-} type FiniteBits :: * -> Constraint class Bits b => FiniteBits b where finiteBitSize :: b -> GHC.Internal.Types.Int View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2a26eee4c05dde46bccc83af3ea0de... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1d2a26eee4c05dde46bccc83af3ea0de... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Marge Bot (@marge-bot)