summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoz Ross <koz.ross@retro-freedom.nz>2021-01-19 10:38:45 +1300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-23 15:30:37 -0500
commit28ef8a8aa4089e0ecd730ce7c41bcf73ee4c09b5 (patch)
tree2619bebb3080008b8ee3fa2344b9f43bfcbf2dd1
parent8f610e52169eb63db7f8827d35553b84563d927c (diff)
downloadhaskell-28ef8a8aa4089e0ecd730ce7c41bcf73ee4c09b5.tar.gz
Add @since annotations for And, Ior, Xor, Iff type class instances
-rw-r--r--libraries/base/Data/Bits.hs54
1 files changed, 45 insertions, 9 deletions
diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs
index f1345e5e93..e0880f3baf 100644
--- a/libraries/base/Data/Bits.hs
+++ b/libraries/base/Data/Bits.hs
@@ -62,7 +62,7 @@ import GHC.Enum
import GHC.Read
import GHC.Show
--- | A more concise version of 'complement zeroBits'.
+-- | A more concise version of @complement zeroBits@.
--
-- >>> complement zeroBits :: Word == oneBits :: Word
-- True
@@ -82,8 +82,17 @@ oneBits = complement zeroBits
--
-- @since 4.16
newtype And a = And { getAnd :: a }
- deriving newtype (Bounded, Enum, Bits, FiniteBits, Eq)
- deriving stock (Show, Read)
+ deriving newtype (
+ Bounded, -- ^ @since 4.16
+ Enum, -- ^ @since 4.16
+ Bits, -- ^ @since 4.16
+ FiniteBits, -- ^ @since 4.16
+ Eq -- ^ @since 4.16
+ )
+ deriving stock (
+ Show, -- ^ @since 4.16
+ Read -- ^ @since 4.16
+ )
-- | @since 4.16
instance (Bits a) => Semigroup (And a) where
@@ -100,8 +109,17 @@ instance (Bits a) => Monoid (And a) where
--
-- @since 4.16
newtype Ior a = Ior { getIor :: a }
- deriving newtype (Bounded, Enum, Bits, FiniteBits, Eq)
- deriving stock (Show, Read)
+ deriving newtype (
+ Bounded, -- ^ @since 4.16
+ Enum, -- ^ @since 4.16
+ Bits, -- ^ @since 4.16
+ FiniteBits, -- ^ @since 4.16
+ Eq -- ^ @since 4.16
+ )
+ deriving stock (
+ Show, -- ^ @since 4.16
+ Read -- ^ @since 4.16
+ )
-- | @since 4.16
instance (Bits a) => Semigroup (Ior a) where
@@ -118,8 +136,17 @@ instance (Bits a) => Monoid (Ior a) where
--
-- @since 4.16
newtype Xor a = Xor { getXor :: a }
- deriving newtype (Bounded, Enum, Bits, FiniteBits, Eq)
- deriving stock (Show, Read)
+ deriving newtype (
+ Bounded, -- ^ @since 4.16
+ Enum, -- ^ @since 4.16
+ Bits, -- ^ @since 4.16
+ FiniteBits, -- ^ @since 4.16
+ Eq -- ^ @since 4.16
+ )
+ deriving stock (
+ Show, -- ^ @since 4.16
+ Read -- ^ @since 4.16
+ )
-- | @since 4.16
instance (Bits a) => Semigroup (Xor a) where
@@ -137,8 +164,17 @@ instance (Bits a) => Monoid (Xor a) where
--
-- @since 4.16
newtype Iff a = Iff { getIff :: a }
- deriving newtype (Bounded, Enum, Bits, FiniteBits, Eq)
- deriving stock (Show, Read)
+ deriving newtype (
+ Bounded, -- ^ @since 4.16
+ Enum, -- ^ @since 4.16
+ Bits, -- ^ @since 4.16
+ FiniteBits, -- ^ @since 4.16
+ Eq -- ^ @since 4.16
+ )
+ deriving stock (
+ Show, -- ^ @since 4.16
+ Read -- ^ @since 4.16
+ )
-- | @since 4.16
instance (Bits a) => Semigroup (Iff a) where