summaryrefslogtreecommitdiff
path: root/libraries/base/GHC
diff options
context:
space:
mode:
authorChaitanya Koparkar <ckoparkar@gmail.com>2018-03-02 16:12:56 -0500
committerBen Gamari <ben@smart-cactus.org>2018-03-02 16:13:07 -0500
commit5c28ee88dd66617b0fd5dbe0d90142ce983a547e (patch)
tree8322c8ec668e4a3db7eeafe6ac11f113ea570094 /libraries/base/GHC
parent6a7e159ce25b432824f8757e0c768f2b2e2754df (diff)
downloadhaskell-5c28ee88dd66617b0fd5dbe0d90142ce983a547e.tar.gz
Add @since annotations for derived instances in base
Test Plan: ./validate Reviewers: hvr, goldfire, bgamari, RyanGlScott Reviewed By: RyanGlScott Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11767 Differential Revision: https://phabricator.haskell.org/D4452
Diffstat (limited to 'libraries/base/GHC')
-rw-r--r--libraries/base/GHC/Base.hs8
-rw-r--r--libraries/base/GHC/ByteOrder.hs8
-rw-r--r--libraries/base/GHC/Conc/Sync.hs10
-rw-r--r--libraries/base/GHC/Conc/Windows.hs7
-rw-r--r--libraries/base/GHC/Event/Control.hs4
-rw-r--r--libraries/base/GHC/Event/EPoll.hsc7
-rw-r--r--libraries/base/GHC/Event/Internal.hs16
-rw-r--r--libraries/base/GHC/Event/KQueue.hsc25
-rw-r--r--libraries/base/GHC/Event/Manager.hs8
-rw-r--r--libraries/base/GHC/Event/Poll.hsc10
-rw-r--r--libraries/base/GHC/Event/TimerManager.hs6
-rw-r--r--libraries/base/GHC/Event/Unique.hs5
-rw-r--r--libraries/base/GHC/Exception.hs8
-rwxr-xr-xlibraries/base/GHC/Exts.hs4
-rw-r--r--libraries/base/GHC/Fingerprint/Type.hs4
-rw-r--r--libraries/base/GHC/Generics.hs210
-rw-r--r--libraries/base/GHC/IO.hs4
-rw-r--r--libraries/base/GHC/IO/Buffer.hs3
-rw-r--r--libraries/base/GHC/IO/Device.hs11
-rw-r--r--libraries/base/GHC/IO/Encoding/Failure.hs3
-rw-r--r--libraries/base/GHC/IO/Encoding/Types.hs4
-rw-r--r--libraries/base/GHC/IO/Exception.hs8
-rw-r--r--libraries/base/GHC/IO/Handle/Lock.hsc3
-rw-r--r--libraries/base/GHC/IO/Handle/Types.hs18
-rw-r--r--libraries/base/GHC/IO/IOMode.hs8
-rw-r--r--libraries/base/GHC/IORef.hs2
-rw-r--r--libraries/base/GHC/Natural.hs6
-rw-r--r--libraries/base/GHC/Ptr.hs5
-rw-r--r--libraries/base/GHC/RTS/Flags.hsc42
-rw-r--r--libraries/base/GHC/Read.hs2
-rw-r--r--libraries/base/GHC/Real.hs2
-rw-r--r--libraries/base/GHC/Show.hs15
-rw-r--r--libraries/base/GHC/Stable.hs2
-rw-r--r--libraries/base/GHC/Stack/Types.hs2
-rw-r--r--libraries/base/GHC/StaticPtr.hs2
-rw-r--r--libraries/base/GHC/Stats.hsc8
-rw-r--r--libraries/base/GHC/Unicode.hs11
37 files changed, 412 insertions, 89 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs
index 17d4151d7c..4d5278978c 100644
--- a/libraries/base/GHC/Base.hs
+++ b/libraries/base/GHC/Base.hs
@@ -211,7 +211,9 @@ foldr = errorWithoutStackTrace "urk"
-- error monad can be built using the 'Data.Either.Either' type.
--
data Maybe a = Nothing | Just a
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 2.01
+ , Ord -- ^ @since 2.01
+ )
infixr 6 <>
@@ -941,7 +943,9 @@ infixr 5 :|
--
-- @since 4.9.0.0
data NonEmpty a = a :| [a]
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
instance Functor NonEmpty where
diff --git a/libraries/base/GHC/ByteOrder.hs b/libraries/base/GHC/ByteOrder.hs
index eecc56c9ad..a1f4da6493 100644
--- a/libraries/base/GHC/ByteOrder.hs
+++ b/libraries/base/GHC/ByteOrder.hs
@@ -20,7 +20,13 @@ module GHC.ByteOrder where
data ByteOrder
= BigEndian -- ^ most-significant-byte occurs in lowest address.
| LittleEndian -- ^ least-significant-byte occurs in lowest address.
- deriving (Eq, Ord, Bounded, Enum, Read, Show)
+ deriving ( Eq -- ^ @since 4.11.0.0
+ , Ord -- ^ @since 4.11.0.0
+ , Bounded -- ^ @since 4.11.0.0
+ , Enum -- ^ @since 4.11.0.0
+ , Read -- ^ @since 4.11.0.0
+ , Show -- ^ @since 4.11.0.0
+ )
-- | The byte ordering of the target machine.
targetByteOrder :: ByteOrder
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs
index 0bd2900e46..517c20e45f 100644
--- a/libraries/base/GHC/Conc/Sync.hs
+++ b/libraries/base/GHC/Conc/Sync.hs
@@ -558,7 +558,10 @@ data BlockReason
-- ^blocked on some other resource. Without @-threaded@,
-- I\/O and 'threadDelay' show up as 'BlockedOnOther', with @-threaded@
-- they show up as 'BlockedOnMVar'.
- deriving (Eq,Ord,Show)
+ deriving ( Eq -- ^ @since 4.3.0.0
+ , Ord -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ )
-- | The current status of a thread
data ThreadStatus
@@ -570,7 +573,10 @@ data ThreadStatus
-- ^the thread is blocked on some resource
| ThreadDied
-- ^the thread received an uncaught exception
- deriving (Eq,Ord,Show)
+ deriving ( Eq -- ^ @since 4.3.0.0
+ , Ord -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ )
threadStatus :: ThreadId -> IO ThreadStatus
threadStatus (ThreadId t) = IO $ \s ->
diff --git a/libraries/base/GHC/Conc/Windows.hs b/libraries/base/GHC/Conc/Windows.hs
index 6b87b06fe7..6c4136428a 100644
--- a/libraries/base/GHC/Conc/Windows.hs
+++ b/libraries/base/GHC/Conc/Windows.hs
@@ -278,7 +278,12 @@ data ConsoleEvent
-- these are sent to Services only.
| Logoff
| Shutdown
- deriving (Eq, Ord, Enum, Show, Read)
+ deriving ( Eq -- ^ @since 4.3.0.0
+ , Ord -- ^ @since 4.3.0.0
+ , Enum -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ , Read -- ^ @since 4.3.0.0
+ )
start_console_handler :: Word32 -> IO ()
start_console_handler r =
diff --git a/libraries/base/GHC/Event/Control.hs b/libraries/base/GHC/Event/Control.hs
index 9e3940ad19..5b4a81b38b 100644
--- a/libraries/base/GHC/Event/Control.hs
+++ b/libraries/base/GHC/Event/Control.hs
@@ -57,7 +57,9 @@ data ControlMessage = CMsgWakeup
| CMsgDie
| CMsgSignal {-# UNPACK #-} !(ForeignPtr Word8)
{-# UNPACK #-} !Signal
- deriving (Eq, Show)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ )
-- | The structure used to tell the IO manager thread what to do.
data Control = W {
diff --git a/libraries/base/GHC/Event/EPoll.hsc b/libraries/base/GHC/Event/EPoll.hsc
index 32bfc3913b..14324bc43d 100644
--- a/libraries/base/GHC/Event/EPoll.hsc
+++ b/libraries/base/GHC/Event/EPoll.hsc
@@ -161,7 +161,12 @@ newtype ControlOp = ControlOp CInt
newtype EventType = EventType {
unEventType :: Word32
- } deriving (Show, Eq, Num, Bits, FiniteBits)
+ } deriving ( Show -- ^ @since 4.4.0.0
+ , Eq -- ^ @since 4.4.0.0
+ , Num -- ^ @since 4.4.0.0
+ , Bits -- ^ @since 4.4.0.0
+ , FiniteBits -- ^ @since 4.7.0.0
+ )
#{enum EventType, EventType
, epollIn = EPOLLIN
diff --git a/libraries/base/GHC/Event/Internal.hs b/libraries/base/GHC/Event/Internal.hs
index b7befdda25..cb048cd14c 100644
--- a/libraries/base/GHC/Event/Internal.hs
+++ b/libraries/base/GHC/Event/Internal.hs
@@ -40,7 +40,7 @@ import Data.Semigroup.Internal (stimesMonoid)
-- | An I\/O event.
newtype Event = Event Int
- deriving (Eq)
+ deriving Eq -- ^ @since 4.4.0.0
evtNothing :: Event
evtNothing = Event 0
@@ -64,7 +64,7 @@ evtClose = Event 4
eventIs :: Event -> Event -> Bool
eventIs (Event a) (Event b) = a .&. b /= 0
--- | @since 4.3.1.0
+-- | @since 4.4.0.0
instance Show Event where
show e = '[' : (intercalate "," . filter (not . null) $
[evtRead `so` "evtRead",
@@ -78,7 +78,7 @@ instance Semigroup Event where
(<>) = evtCombine
stimes = stimesMonoid
--- | @since 4.3.1.0
+-- | @since 4.4.0.0
instance Monoid Event where
mempty = evtNothing
mconcat = evtConcat
@@ -97,7 +97,9 @@ evtConcat = foldl' evtCombine evtNothing
data Lifetime = OneShot -- ^ the registration will be active for only one
-- event
| MultiShot -- ^ the registration will trigger multiple times
- deriving (Show, Eq)
+ deriving ( Show -- ^ @since 4.8.1.0
+ , Eq -- ^ @since 4.8.1.0
+ )
-- | The longer of two lifetimes.
elSupremum :: Lifetime -> Lifetime -> Lifetime
@@ -121,7 +123,9 @@ instance Monoid Lifetime where
-- Here we encode the event in the bottom three bits and the lifetime
-- in the fourth bit.
newtype EventLifetime = EL Int
- deriving (Show, Eq)
+ deriving ( Show -- ^ @since 4.8.0.0
+ , Eq -- ^ @since 4.8.0.0
+ )
-- | @since 4.11.0.0
instance Semigroup EventLifetime where
@@ -149,7 +153,7 @@ elEvent (EL x) = Event (x .&. 0x7)
-- | A type alias for timeouts, specified in nanoseconds.
data Timeout = Timeout {-# UNPACK #-} !Word64
| Forever
- deriving (Show)
+ deriving Show -- ^ @since 4.4.0.0
-- | Event notification backend.
data Backend = forall a. Backend {
diff --git a/libraries/base/GHC/Event/KQueue.hsc b/libraries/base/GHC/Event/KQueue.hsc
index 59b5ce1a1e..49cf82db14 100644
--- a/libraries/base/GHC/Event/KQueue.hsc
+++ b/libraries/base/GHC/Event/KQueue.hsc
@@ -124,7 +124,9 @@ poll kq mtimeout f = do
newtype KQueueFd = KQueueFd {
fromKQueueFd :: CInt
- } deriving (Eq, Show)
+ } deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ )
data Event = KEvent {
ident :: {-# UNPACK #-} !CUIntPtr
@@ -137,7 +139,7 @@ data Event = KEvent {
, data_ :: {-# UNPACK #-} !CIntPtr
#endif
, udata :: {-# UNPACK #-} !(Ptr ())
- } deriving Show
+ } deriving Show -- ^ @since 4.4.0.0
toEvents :: Fd -> [Filter] -> Flag -> FFlag -> [Event]
toEvents fd flts flag fflag = map (\filt -> KEvent (fromIntegral fd) filt flag fflag 0 nullPtr) flts
@@ -167,7 +169,10 @@ instance Storable Event where
#{poke struct kevent, udata} ptr (udata ev)
newtype FFlag = FFlag Word32
- deriving (Eq, Show, Storable)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ , Storable -- ^ @since 4.4.0.0
+ )
#{enum FFlag, FFlag
, noteEOF = NOTE_EOF
@@ -178,7 +183,13 @@ newtype Flag = Flag Word32
#else
newtype Flag = Flag Word16
#endif
- deriving (Bits, FiniteBits, Eq, Num, Show, Storable)
+ deriving ( Bits -- ^ @since 4.7.0.0
+ , FiniteBits -- ^ @since 4.7.0.0
+ , Eq -- ^ @since 4.4.0.0
+ , Num -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.4.0.0
+ , Storable -- ^ @since 4.4.0.0
+ )
#{enum Flag, Flag
, flagAdd = EV_ADD
@@ -191,7 +202,11 @@ newtype Filter = Filter Int32
#else
newtype Filter = Filter Int16
#endif
- deriving (Eq, Num, Show, Storable)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Num -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ , Storable -- ^ @since 4.4.0.0
+ )
filterRead :: Filter
filterRead = Filter (#const EVFILT_READ)
diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs
index 013850b5d2..3ee9116812 100644
--- a/libraries/base/GHC/Event/Manager.hs
+++ b/libraries/base/GHC/Event/Manager.hs
@@ -110,7 +110,9 @@ data FdData = FdData {
data FdKey = FdKey {
keyFd :: {-# UNPACK #-} !Fd
, keyUnique :: {-# UNPACK #-} !Unique
- } deriving (Eq, Show)
+ } deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ )
-- | Callback invoked on I/O events.
type IOCallback = FdKey -> Event -> IO ()
@@ -120,7 +122,9 @@ data State = Created
| Dying
| Releasing
| Finished
- deriving (Eq, Show)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ )
-- | The event manager state.
data EventManager = EventManager
diff --git a/libraries/base/GHC/Event/Poll.hsc b/libraries/base/GHC/Event/Poll.hsc
index 74525c6b40..1dafd601ec 100644
--- a/libraries/base/GHC/Event/Poll.hsc
+++ b/libraries/base/GHC/Event/Poll.hsc
@@ -151,10 +151,16 @@ data PollFd = PollFd {
pfdFd :: {-# UNPACK #-} !Fd
, pfdEvents :: {-# UNPACK #-} !Event
, pfdRevents :: {-# UNPACK #-} !Event
- } deriving (Show)
+ } deriving Show -- ^ @since 4.4.0.0
newtype Event = Event CShort
- deriving (Eq, Show, Num, Storable, Bits, FiniteBits)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ , Num -- ^ @since 4.4.0.0
+ , Storable -- ^ @since 4.4.0.0
+ , Bits -- ^ @since 4.4.0.0
+ , FiniteBits -- ^ @since 4.7.0.0
+ )
-- We have to duplicate the whole enum like this in order for the
-- hsc2hs cross-compilation mode to work
diff --git a/libraries/base/GHC/Event/TimerManager.hs b/libraries/base/GHC/Event/TimerManager.hs
index b7e7615721..046f49e280 100644
--- a/libraries/base/GHC/Event/TimerManager.hs
+++ b/libraries/base/GHC/Event/TimerManager.hs
@@ -67,7 +67,7 @@ import qualified GHC.Event.Poll as Poll
-- | A timeout registration cookie.
newtype TimeoutKey = TK Unique
- deriving (Eq)
+ deriving Eq -- ^ @since 4.7.0.0
-- | Callback invoked on timeout events.
type TimeoutCallback = IO ()
@@ -76,7 +76,9 @@ data State = Created
| Running
| Dying
| Finished
- deriving (Eq, Show)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ )
-- | A priority search queue, with timeouts as priorities.
type TimeoutQueue = Q.PSQ TimeoutCallback
diff --git a/libraries/base/GHC/Event/Unique.hs b/libraries/base/GHC/Event/Unique.hs
index 0363af2068..1339bd97e7 100644
--- a/libraries/base/GHC/Event/Unique.hs
+++ b/libraries/base/GHC/Event/Unique.hs
@@ -19,7 +19,10 @@ import GHC.Show(Show(..))
data UniqueSource = US (MutableByteArray# RealWorld)
newtype Unique = Unique { asInt :: Int }
- deriving (Eq, Ord, Num)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Ord -- ^ @since 4.4.0.0
+ , Num -- ^ @since 4.4.0.0
+ )
-- | @since 4.3.1.0
instance Show Unique where
diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs
index 37f47a6123..df90cb245a 100644
--- a/libraries/base/GHC/Exception.hs
+++ b/libraries/base/GHC/Exception.hs
@@ -170,7 +170,9 @@ throw e = raise# (toException e)
-- | This is thrown when the user calls 'error'. The first @String@ is the
-- argument given to 'error', second @String@ is the location.
data ErrorCall = ErrorCallWithLocation String String
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ )
pattern ErrorCall :: String -> ErrorCall
pattern ErrorCall err <- ErrorCallWithLocation err _ where
@@ -240,7 +242,9 @@ data ArithException
| DivideByZero
| Denormal
| RatioZeroDenominator -- ^ @since 4.6.0.0
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 3.0
+ , Ord -- ^ @since 3.0
+ )
divZeroException, overflowException, ratioZeroDenomException, underflowException :: SomeException
divZeroException = toException DivideByZero
diff --git a/libraries/base/GHC/Exts.hs b/libraries/base/GHC/Exts.hs
index a306437cea..11d329ac19 100755
--- a/libraries/base/GHC/Exts.hs
+++ b/libraries/base/GHC/Exts.hs
@@ -154,7 +154,9 @@ traceEvent = Debug.Trace.traceEventIO
-- entire ghc package at runtime
data SpecConstrAnnotation = NoSpecConstr | ForceSpecConstr
- deriving( Data, Eq )
+ deriving ( Data -- ^ @since 4.3.0.0
+ , Eq -- ^ @since 4.3.0.0
+ )
{- **********************************************************************
diff --git a/libraries/base/GHC/Fingerprint/Type.hs b/libraries/base/GHC/Fingerprint/Type.hs
index 1ad34a7791..234bac1d43 100644
--- a/libraries/base/GHC/Fingerprint/Type.hs
+++ b/libraries/base/GHC/Fingerprint/Type.hs
@@ -22,7 +22,9 @@ import Numeric (showHex)
-- Using 128-bit MD5 fingerprints for now.
data Fingerprint = Fingerprint {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Ord -- ^ @since 4.4.0.0
+ )
-- | @since 4.7.0.0
instance Show Fingerprint where
diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs
index 3ae9a2cec5..ff44cf81c3 100644
--- a/libraries/base/GHC/Generics.hs
+++ b/libraries/base/GHC/Generics.hs
@@ -767,13 +767,15 @@ data V1 (p :: k)
-- | Unit: used for constructors without arguments
data U1 (p :: k) = U1
- deriving (Generic, Generic1)
+ deriving ( Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
instance Eq (U1 p) where
_ == _ = True
--- | @since 4.9.0.0
+-- | @since 4.7.0.0
instance Ord (U1 p) where
compare _ _ = EQ
@@ -808,7 +810,14 @@ instance MonadPlus U1
-- | Used for marking occurrences of the parameter
newtype Par1 p = Par1 { unPar1 :: p }
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
instance Applicative Par1 where
@@ -823,7 +832,14 @@ instance Monad Par1 where
-- | Recursive calls of kind @* -> *@ (or kind @k -> *@, when @PolyKinds@
-- is enabled)
newtype Rec1 (f :: k -> *) (p :: k) = Rec1 { unRec1 :: f p }
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
deriving instance Applicative f => Applicative (Rec1 f)
@@ -840,7 +856,14 @@ deriving instance MonadPlus f => MonadPlus (Rec1 f)
-- | Constants, additional parameters and recursion of kind @*@
newtype K1 (i :: *) c (p :: k) = K1 { unK1 :: c }
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
deriving instance Applicative f => Applicative (M1 i c f)
@@ -856,17 +879,38 @@ deriving instance MonadPlus f => MonadPlus (M1 i c f)
-- | Meta-information (constructor names, etc.)
newtype M1 (i :: *) (c :: Meta) (f :: k -> *) (p :: k) = M1 { unM1 :: f p }
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Sums: encode choice between constructors
infixr 5 :+:
data (:+:) (f :: k -> *) (g :: k -> *) (p :: k) = L1 (f p) | R1 (g p)
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Products: encode multiple arguments to constructors
infixr 6 :*:
data (:*:) (f :: k -> *) (g :: k -> *) (p :: k) = f p :*: g p
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
instance (Applicative f, Applicative g) => Applicative (f :*: g) where
@@ -893,7 +937,14 @@ instance (MonadPlus f, MonadPlus g) => MonadPlus (f :*: g)
infixr 7 :.:
newtype (:.:) (f :: k2 -> *) (g :: k1 -> k2) (p :: k1) =
Comp1 { unComp1 :: f (g p) }
- deriving (Eq, Ord, Read, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.7.0.0
+ , Ord -- ^ @since 4.7.0.0
+ , Read -- ^ @since 4.7.0.0
+ , Show -- ^ @since 4.7.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | @since 4.9.0.0
instance (Applicative f, Applicative g) => Applicative (f :.: g) where
@@ -916,37 +967,70 @@ data family URec (a :: *) (p :: k)
--
-- @since 4.9.0.0
data instance URec (Ptr ()) (p :: k) = UAddr { uAddr# :: Addr# }
- deriving (Eq, Ord, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Used for marking occurrences of 'Char#'
--
-- @since 4.9.0.0
data instance URec Char (p :: k) = UChar { uChar# :: Char# }
- deriving (Eq, Ord, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Used for marking occurrences of 'Double#'
--
-- @since 4.9.0.0
data instance URec Double (p :: k) = UDouble { uDouble# :: Double# }
- deriving (Eq, Ord, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Used for marking occurrences of 'Float#'
--
-- @since 4.9.0.0
data instance URec Float (p :: k) = UFloat { uFloat# :: Float# }
- deriving (Eq, Ord, Show, Functor, Generic, Generic1)
+ deriving ( Eq, Ord, Show
+ , Functor -- ^ @since 4.9.0.0
+ , Generic
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Used for marking occurrences of 'Int#'
--
-- @since 4.9.0.0
data instance URec Int (p :: k) = UInt { uInt# :: Int# }
- deriving (Eq, Ord, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Used for marking occurrences of 'Word#'
--
-- @since 4.9.0.0
data instance URec Word (p :: k) = UWord { uWord# :: Word# }
- deriving (Eq, Ord, Show, Functor, Generic, Generic1)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Functor -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ , Generic1 -- ^ @since 4.9.0.0
+ )
-- | Type synonym for @'URec' 'Addr#'@
--
@@ -1046,7 +1130,12 @@ instance (KnownSymbol n, SingI f, SingI r)
-- | Datatype to represent the fixity of a constructor. An infix
-- | declaration directly corresponds to an application of 'Infix'.
data Fixity = Prefix | Infix Associativity Int
- deriving (Eq, Show, Ord, Read, Generic)
+ deriving ( Eq -- ^ @since 4.6.0.0
+ , Show -- ^ @since 4.6.0.0
+ , Ord -- ^ @since 4.6.0.0
+ , Read -- ^ @since 4.6.0.0
+ , Generic -- ^ @since 4.7.0.0
+ )
-- | This variant of 'Fixity' appears at the type level.
--
@@ -1062,7 +1151,15 @@ prec (Infix _ n) = n
data Associativity = LeftAssociative
| RightAssociative
| NotAssociative
- deriving (Eq, Show, Ord, Read, Enum, Bounded, Ix, Generic)
+ deriving ( Eq -- ^ @since 4.6.0.0
+ , Show -- ^ @since 4.6.0.0
+ , Ord -- ^ @since 4.6.0.0
+ , Read -- ^ @since 4.6.0.0
+ , Enum -- ^ @since 4.9.0.0
+ , Bounded -- ^ @since 4.9.0.0
+ , Ix -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.7.0.0
+ )
-- | The unpackedness of a field as the user wrote it in the source code. For
-- example, in the following data type:
@@ -1080,7 +1177,15 @@ data Associativity = LeftAssociative
data SourceUnpackedness = NoSourceUnpackedness
| SourceNoUnpack
| SourceUnpack
- deriving (Eq, Show, Ord, Read, Enum, Bounded, Ix, Generic)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Read -- ^ @since 4.9.0.0
+ , Enum -- ^ @since 4.9.0.0
+ , Bounded -- ^ @since 4.9.0.0
+ , Ix -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ )
-- | The strictness of a field as the user wrote it in the source code. For
-- example, in the following data type:
@@ -1096,7 +1201,15 @@ data SourceUnpackedness = NoSourceUnpackedness
data SourceStrictness = NoSourceStrictness
| SourceLazy
| SourceStrict
- deriving (Eq, Show, Ord, Read, Enum, Bounded, Ix, Generic)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Read -- ^ @since 4.9.0.0
+ , Enum -- ^ @since 4.9.0.0
+ , Bounded -- ^ @since 4.9.0.0
+ , Ix -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ )
-- | The strictness that GHC infers for a field during compilation. Whereas
-- there are nine different combinations of 'SourceUnpackedness' and
@@ -1123,7 +1236,15 @@ data SourceStrictness = NoSourceStrictness
data DecidedStrictness = DecidedLazy
| DecidedStrict
| DecidedUnpack
- deriving (Eq, Show, Ord, Read, Enum, Bounded, Ix, Generic)
+ deriving ( Eq -- ^ @since 4.9.0.0
+ , Show -- ^ @since 4.9.0.0
+ , Ord -- ^ @since 4.9.0.0
+ , Read -- ^ @since 4.9.0.0
+ , Enum -- ^ @since 4.9.0.0
+ , Bounded -- ^ @since 4.9.0.0
+ , Ix -- ^ @since 4.9.0.0
+ , Generic -- ^ @since 4.9.0.0
+ )
-- | Class for datatypes that represent records
class Selector s where
@@ -1215,31 +1336,80 @@ data Meta = MetaData Symbol Symbol Symbol Bool
-- Derived instances
--------------------------------------------------------------------------------
+-- | @since 4.6.0.0
deriving instance Generic [a]
+
+-- | @since 4.6.0.0
deriving instance Generic (NonEmpty a)
+
+-- | @since 4.6.0.0
deriving instance Generic (Maybe a)
+
+-- | @since 4.6.0.0
deriving instance Generic (Either a b)
+
+-- | @since 4.6.0.0
deriving instance Generic Bool
+
+-- | @since 4.6.0.0
deriving instance Generic Ordering
+
+-- | @since 4.6.0.0
deriving instance Generic (Proxy t)
+
+-- | @since 4.6.0.0
deriving instance Generic ()
+
+-- | @since 4.6.0.0
deriving instance Generic ((,) a b)
+
+-- | @since 4.6.0.0
deriving instance Generic ((,,) a b c)
+
+-- | @since 4.6.0.0
deriving instance Generic ((,,,) a b c d)
+
+-- | @since 4.6.0.0
deriving instance Generic ((,,,,) a b c d e)
+
+-- | @since 4.6.0.0
deriving instance Generic ((,,,,,) a b c d e f)
+
+-- | @since 4.6.0.0
deriving instance Generic ((,,,,,,) a b c d e f g)
+
+-- | @since 4.6.0.0
deriving instance Generic1 []
+
+-- | @since 4.6.0.0
deriving instance Generic1 NonEmpty
+
+-- | @since 4.6.0.0
deriving instance Generic1 Maybe
+
+-- | @since 4.6.0.0
deriving instance Generic1 (Either a)
+
+-- | @since 4.6.0.0
deriving instance Generic1 Proxy
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,) a)
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,,) a b)
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,,,) a b c)
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,,,,) a b c d)
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,,,,,) a b c d e)
+
+-- | @since 4.6.0.0
deriving instance Generic1 ((,,,,,,) a b c d e f)
--------------------------------------------------------------------------------
diff --git a/libraries/base/GHC/IO.hs b/libraries/base/GHC/IO.hs
index 8d69b707e1..05ad277127 100644
--- a/libraries/base/GHC/IO.hs
+++ b/libraries/base/GHC/IO.hs
@@ -279,7 +279,9 @@ data MaskingState
-- ^ the state during 'mask': asynchronous exceptions are masked, but blocking operations may still be interrupted
| MaskedUninterruptible
-- ^ the state during 'uninterruptibleMask': asynchronous exceptions are masked, and blocking operations may not be interrupted
- deriving (Eq,Show)
+ deriving ( Eq -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ )
-- | Returns the 'MaskingState' for the current thread.
getMaskingState :: IO MaskingState
diff --git a/libraries/base/GHC/IO/Buffer.hs b/libraries/base/GHC/IO/Buffer.hs
index f3cabb25c1..447c574e2b 100644
--- a/libraries/base/GHC/IO/Buffer.hs
+++ b/libraries/base/GHC/IO/Buffer.hs
@@ -192,7 +192,8 @@ type CharBuffer = Buffer Word16
type CharBuffer = Buffer Char
#endif
-data BufferState = ReadBuffer | WriteBuffer deriving (Eq)
+data BufferState = ReadBuffer | WriteBuffer
+ deriving Eq -- ^ @since 4.2.0.0
withBuffer :: Buffer e -> (Ptr e -> IO a) -> IO a
withBuffer Buffer{ bufRaw=raw } f = withForeignPtr (castForeignPtr raw) f
diff --git a/libraries/base/GHC/IO/Device.hs b/libraries/base/GHC/IO/Device.hs
index ddeb861eca..1f6304b5d9 100644
--- a/libraries/base/GHC/IO/Device.hs
+++ b/libraries/base/GHC/IO/Device.hs
@@ -154,7 +154,8 @@ data IODeviceType
-- read and write operations and may be seekable only
-- to positions of certain granularity (block-
-- aligned).
- deriving (Eq)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ )
-- -----------------------------------------------------------------------------
-- SeekMode type
@@ -166,5 +167,11 @@ data SeekMode
-- from the current position.
| SeekFromEnd -- ^ the position of @hdl@ is set to offset @i@
-- from the end of the file.
- deriving (Eq, Ord, Ix, Enum, Read, Show)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.2.0.0
+ , Ix -- ^ @since 4.2.0.0
+ , Enum -- ^ @since 4.2.0.0
+ , Read -- ^ @since 4.2.0.0
+ , Show -- ^ @since 4.2.0.0
+ )
diff --git a/libraries/base/GHC/IO/Encoding/Failure.hs b/libraries/base/GHC/IO/Encoding/Failure.hs
index 3f9360d731..3047d494ac 100644
--- a/libraries/base/GHC/IO/Encoding/Failure.hs
+++ b/libraries/base/GHC/IO/Encoding/Failure.hs
@@ -48,7 +48,8 @@ data CodingFailureMode
| RoundtripFailure
-- ^ Use the private-use escape mechanism to attempt to allow
-- illegal sequences to be roundtripped.
- deriving (Show)
+ deriving ( Show -- ^ @since 4.4.0.0
+ )
-- This will only work properly for those encodings which are
-- strict supersets of ASCII in the sense that valid ASCII data
-- is also valid in that encoding. This is not true for
diff --git a/libraries/base/GHC/IO/Encoding/Types.hs b/libraries/base/GHC/IO/Encoding/Types.hs
index daab9d5157..d6e00899db 100644
--- a/libraries/base/GHC/IO/Encoding/Types.hs
+++ b/libraries/base/GHC/IO/Encoding/Types.hs
@@ -129,5 +129,7 @@ data CodingProgress = InputUnderflow -- ^ Stopped because the input contains in
| InvalidSequence -- ^ Stopped because there are sufficient free elements in the output
-- to output at least one encoded ASCII character, but the input contains
-- an invalid or unrepresentable sequence
- deriving (Eq, Show)
+ deriving ( Eq -- ^ @since 4.4.0.0
+ , Show -- ^ @since 4.4.0.0
+ )
diff --git a/libraries/base/GHC/IO/Exception.hs b/libraries/base/GHC/IO/Exception.hs
index 020bc067df..f6b60a44e8 100644
--- a/libraries/base/GHC/IO/Exception.hs
+++ b/libraries/base/GHC/IO/Exception.hs
@@ -226,7 +226,9 @@ data AsyncException
-- ^This exception is raised by default in the main thread of
-- the program when the user requests to terminate the program
-- via the usual mechanism(s) (e.g. Control-C in the console).
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.2.0.0
+ )
-- | @since 4.7.0.0
instance Exception AsyncException where
@@ -241,7 +243,9 @@ data ArrayException
| UndefinedElement String
-- ^An attempt was made to evaluate an element of an
-- array that had not been initialized.
- deriving (Eq, Ord)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.2.0.0
+ )
-- | @since 4.1.0.0
instance Exception ArrayException
diff --git a/libraries/base/GHC/IO/Handle/Lock.hsc b/libraries/base/GHC/IO/Handle/Lock.hsc
index b0a3449a2f..ec85ffd25e 100644
--- a/libraries/base/GHC/IO/Handle/Lock.hsc
+++ b/libraries/base/GHC/IO/Handle/Lock.hsc
@@ -63,8 +63,9 @@ import GHC.Show
-- | Exception thrown by 'hLock' on non-Windows platforms that don't support
-- 'flock'.
data FileLockingNotSupported = FileLockingNotSupported
- deriving Show
+ deriving Show -- ^ @since 4.10.0.0
+-- ^ @since 4.10.0.0
instance Exception FileLockingNotSupported
-- | Indicates a mode in which a file should be locked.
diff --git a/libraries/base/GHC/IO/Handle/Types.hs b/libraries/base/GHC/IO/Handle/Types.hs
index c58a9fb1b0..d38962e77e 100644
--- a/libraries/base/GHC/IO/Handle/Types.hs
+++ b/libraries/base/GHC/IO/Handle/Types.hs
@@ -247,7 +247,11 @@ data BufferMode
-- ^ block-buffering should be enabled if possible.
-- The size of the buffer is @n@ items if the argument
-- is 'Just' @n@ and is otherwise implementation-dependent.
- deriving (Eq, Ord, Read, Show)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.2.0.0
+ , Read -- ^ @since 4.2.0.0
+ , Show -- ^ @since 4.2.0.0
+ )
{-
[note Buffering Implementation]
@@ -349,7 +353,11 @@ and hence it is only possible on a seekable Handle.
-- | The representation of a newline in the external file or stream.
data Newline = LF -- ^ '\n'
| CRLF -- ^ '\r\n'
- deriving (Eq, Ord, Read, Show)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.3.0.0
+ , Read -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ )
-- | Specifies the translation, if any, of newline characters between
-- internal Strings and the external file or stream. Haskell Strings
@@ -362,7 +370,11 @@ data NewlineMode
outputNL :: Newline
-- ^ the representation of newlines on output
}
- deriving (Eq, Ord, Read, Show)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.3.0.0
+ , Read -- ^ @since 4.3.0.0
+ , Show -- ^ @since 4.3.0.0
+ )
-- | The native newline representation for the current platform: 'LF'
-- on Unix systems, 'CRLF' on Windows.
diff --git a/libraries/base/GHC/IO/IOMode.hs b/libraries/base/GHC/IO/IOMode.hs
index 42cc9f31b1..7eb848f50a 100644
--- a/libraries/base/GHC/IO/IOMode.hs
+++ b/libraries/base/GHC/IO/IOMode.hs
@@ -26,5 +26,11 @@ import GHC.Enum
-- | See 'System.IO.openFile'
data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
- deriving (Eq, Ord, Ix, Enum, Read, Show)
+ deriving ( Eq -- ^ @since 4.2.0.0
+ , Ord -- ^ @since 4.2.0.0
+ , Ix -- ^ @since 4.2.0.0
+ , Enum -- ^ @since 4.2.0.0
+ , Read -- ^ @since 4.2.0.0
+ , Show -- ^ @since 4.2.0.0
+ )
diff --git a/libraries/base/GHC/IORef.hs b/libraries/base/GHC/IORef.hs
index 0832be04cf..7377690f0f 100644
--- a/libraries/base/GHC/IORef.hs
+++ b/libraries/base/GHC/IORef.hs
@@ -31,7 +31,7 @@ import GHC.IO
-- |A mutable variable in the 'IO' monad
newtype IORef a = IORef (STRef RealWorld a)
- deriving Eq
+ deriving Eq -- ^ @since 4.2.0.0
-- ^ Pointer equality.
--
-- @since 4.1.0.0
diff --git a/libraries/base/GHC/Natural.hs b/libraries/base/GHC/Natural.hs
index 7e6d0a1026..32cf2d2579 100644
--- a/libraries/base/GHC/Natural.hs
+++ b/libraries/base/GHC/Natural.hs
@@ -101,8 +101,12 @@ data Natural = NatS# GmpLimb# -- ^ in @[0, maxBound::Word]@
-- __Invariant__: 'NatJ#' is used
-- /iff/ value doesn't fit in
-- 'NatS#' constructor.
- deriving (Eq,Ord) -- NB: Order of constructors *must*
+ -- NB: Order of constructors *must*
-- coincide with 'Ord' relation
+ deriving ( Eq -- ^ @since 4.8.0.0
+ , Ord -- ^ @since 4.8.0.0
+ )
+
-- | Test whether all internal invariants are satisfied by 'Natural' value
--
diff --git a/libraries/base/GHC/Ptr.hs b/libraries/base/GHC/Ptr.hs
index 93f6d64ae5..f7caf164af 100644
--- a/libraries/base/GHC/Ptr.hs
+++ b/libraries/base/GHC/Ptr.hs
@@ -42,7 +42,10 @@ import Numeric ( showHex )
-- redundant role annotation checks that this doesn't change
type role Ptr phantom
-data Ptr a = Ptr Addr# deriving (Eq, Ord)
+data Ptr a = Ptr Addr#
+ deriving ( Eq -- ^ @since 2.01
+ , Ord -- ^ @since 2.01
+ )
-- ^ A value of type @'Ptr' a@ represents a pointer to an object, or an
-- array of objects, which may be marshalled to or from Haskell values
-- of type @a@.
diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc
index 1f997c80db..3e712ca900 100644
--- a/libraries/base/GHC/RTS/Flags.hsc
+++ b/libraries/base/GHC/RTS/Flags.hsc
@@ -66,7 +66,8 @@ data GiveGCStats
| OneLineGCStats
| SummaryGCStats
| VerboseGCStats
- deriving (Show)
+ deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | @since 4.8.0.0
instance Enum GiveGCStats where
@@ -115,7 +116,8 @@ data GCFlags = GCFlags
, allocLimitGrace :: Word
, numa :: Bool
, numaMask :: Word
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Parameters concerning context switching
--
@@ -123,7 +125,8 @@ data GCFlags = GCFlags
data ConcFlags = ConcFlags
{ ctxtSwitchTime :: RtsTime
, ctxtSwitchTicks :: Int
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Miscellaneous parameters
--
@@ -137,7 +140,8 @@ data MiscFlags = MiscFlags
, machineReadable :: Bool
, linkerMemBase :: Word
-- ^ address to ask the OS for memory for the linker, 0 ==> off
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Flags to control debugging output & extra checking in various
-- subsystems.
@@ -159,7 +163,8 @@ data DebugFlags = DebugFlags
, squeeze :: Bool -- ^ 'z' stack squeezing & lazy blackholing
, hpc :: Bool -- ^ 'c' coverage
, sparks :: Bool -- ^ 'r'
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Should the RTS produce a cost-center summary?
--
@@ -170,7 +175,8 @@ data DoCostCentres
| CostCentresVerbose
| CostCentresAll
| CostCentresJSON
- deriving (Show)
+ deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | @since 4.8.0.0
instance Enum DoCostCentres where
@@ -194,7 +200,8 @@ data CCFlags = CCFlags
{ doCostCentres :: DoCostCentres
, profilerTicks :: Int
, msecsPerTick :: Int
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | What sort of heap profile are we collecting?
--
@@ -208,7 +215,8 @@ data DoHeapProfile
| HeapByRetainer
| HeapByLDV
| HeapByClosureType
- deriving (Show)
+ deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | @since 4.8.0.0
instance Enum DoHeapProfile where
@@ -249,7 +257,8 @@ data ProfFlags = ProfFlags
, ccsSelector :: Maybe String
, retainerSelector :: Maybe String
, bioSelector :: Maybe String
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Is event tracing enabled?
--
@@ -258,7 +267,8 @@ data DoTrace
= TraceNone -- ^ no tracing
| TraceEventLog -- ^ send tracing events to the event log
| TraceStderr -- ^ send tracing events to @stderr@
- deriving (Show)
+ deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | @since 4.8.0.0
instance Enum DoTrace where
@@ -282,7 +292,8 @@ data TraceFlags = TraceFlags
, sparksSampled :: Bool -- ^ trace spark events by a sampled method
, sparksFull :: Bool -- ^ trace spark events 100% accurately
, user :: Bool -- ^ trace user events (emitted from Haskell code)
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Parameters pertaining to ticky-ticky profiler
--
@@ -290,7 +301,8 @@ data TraceFlags = TraceFlags
data TickyFlags = TickyFlags
{ showTickyStats :: Bool
, tickyFile :: Maybe FilePath
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Parameters pertaining to parallelism
--
@@ -307,7 +319,8 @@ data ParFlags = ParFlags
, parGcThreads :: Word32
, setAffinity :: Bool
}
- deriving (Show)
+ deriving ( Show -- ^ @since 4.8.0.0
+ )
-- | Parameters of the runtime system
--
@@ -322,7 +335,8 @@ data RTSFlags = RTSFlags
, traceFlags :: TraceFlags
, tickyFlags :: TickyFlags
, parFlags :: ParFlags
- } deriving (Show)
+ } deriving ( Show -- ^ @since 4.8.0.0
+ )
foreign import ccall "&RtsFlags" rtsFlagsPtr :: Ptr RTSFlags
diff --git a/libraries/base/GHC/Read.hs b/libraries/base/GHC/Read.hs
index 8160a2a704..ad51c46ec5 100644
--- a/libraries/base/GHC/Read.hs
+++ b/libraries/base/GHC/Read.hs
@@ -409,6 +409,7 @@ readSymField fieldName readVal = do
-- Simple instances of Read
--------------------------------------------------------------
+-- | @since 2.01
deriving instance Read GeneralCategory
-- | @since 2.01
@@ -458,6 +459,7 @@ instance Read Ordering where
readListPrec = readListPrecDefault
readList = readListDefault
+-- | @since 4.11.0.0
deriving instance Read a => Read (NonEmpty a)
--------------------------------------------------------------
diff --git a/libraries/base/GHC/Real.hs b/libraries/base/GHC/Real.hs
index 4ab4b2f793..938dff6bce 100644
--- a/libraries/base/GHC/Real.hs
+++ b/libraries/base/GHC/Real.hs
@@ -66,7 +66,7 @@ overflowError = raise# overflowException
--------------------------------------------------------------
-- | Rational numbers, with numerator and denominator of some 'Integral' type.
-data Ratio a = !a :% !a deriving (Eq)
+data Ratio a = !a :% !a deriving Eq -- ^ @since 2.01
-- | Arbitrary-precision rational numbers, represented as a ratio of
-- two 'Integer' values. A rational number may be constructed using
diff --git a/libraries/base/GHC/Show.hs b/libraries/base/GHC/Show.hs
index d1c607556e..a7a7f89bde 100644
--- a/libraries/base/GHC/Show.hs
+++ b/libraries/base/GHC/Show.hs
@@ -165,6 +165,7 @@ appPrec1 = I# 11# -- appPrec + 1
-- Simple Instances
--------------------------------------------------------------
+-- | @since 2.01
deriving instance Show ()
-- | @since 2.01
@@ -174,7 +175,10 @@ instance Show a => Show [a] where
{-# SPECIALISE instance Show [Int] #-}
showsPrec _ = showList
+-- | @since 2.01
deriving instance Show Bool
+
+-- | @since 2.01
deriving instance Show Ordering
-- | @since 2.01
@@ -199,7 +203,10 @@ showWord w# cs
c# ->
showWord (w# `quotWord#` 10##) (C# c# : cs)
+-- | @since 2.01
deriving instance Show a => Show (Maybe a)
+
+-- | @since 4.11.0.0
deriving instance Show a => Show (NonEmpty a)
-- | @since 2.01
@@ -219,6 +226,7 @@ instance Show Module where
instance Show CallStack where
showsPrec _ = shows . getCallStack
+-- | @since 4.9.0.0
deriving instance Show SrcLoc
--------------------------------------------------------------
@@ -581,7 +589,14 @@ instance Show KindRep where
. showString " "
. showsPrec 11 q
+-- | @since 4.11.0.0
deriving instance Show RuntimeRep
+
+-- | @since 4.11.0.0
deriving instance Show VecCount
+
+-- | @since 4.11.0.0
deriving instance Show VecElem
+
+-- | @since 4.11.0.0
deriving instance Show TypeLitSort
diff --git a/libraries/base/GHC/Stable.hs b/libraries/base/GHC/Stable.hs
index 73095bd44a..516b816fa9 100644
--- a/libraries/base/GHC/Stable.hs
+++ b/libraries/base/GHC/Stable.hs
@@ -101,7 +101,7 @@ castStablePtrToPtr (StablePtr s) = Ptr (unsafeCoerce# s)
castPtrToStablePtr :: Ptr () -> StablePtr a
castPtrToStablePtr (Ptr a) = StablePtr (unsafeCoerce# a)
--- | @since 2.1
+-- | @since 2.01
instance Eq (StablePtr a) where
(StablePtr sp1) == (StablePtr sp2) =
case eqStablePtr# sp1 sp2 of
diff --git a/libraries/base/GHC/Stack/Types.hs b/libraries/base/GHC/Stack/Types.hs
index b5858f2fa0..d40342c9de 100644
--- a/libraries/base/GHC/Stack/Types.hs
+++ b/libraries/base/GHC/Stack/Types.hs
@@ -215,4 +215,4 @@ data SrcLoc = SrcLoc
, srcLocStartCol :: Int
, srcLocEndLine :: Int
, srcLocEndCol :: Int
- } deriving Eq
+ } deriving Eq -- ^ @since 4.9.0.0
diff --git a/libraries/base/GHC/StaticPtr.hs b/libraries/base/GHC/StaticPtr.hs
index 92829acb73..34f720dc10 100644
--- a/libraries/base/GHC/StaticPtr.hs
+++ b/libraries/base/GHC/StaticPtr.hs
@@ -115,7 +115,7 @@ data StaticPtrInfo = StaticPtrInfo
-- @(Line, Column)@ pair.
, spInfoSrcLoc :: (Int, Int)
}
- deriving (Show)
+ deriving Show -- ^ @since 4.8.0.0
-- | 'StaticPtrInfo' of the given 'StaticPtr'.
staticPtrInfo :: StaticPtr a -> StaticPtrInfo
diff --git a/libraries/base/GHC/Stats.hsc b/libraries/base/GHC/Stats.hsc
index 94d04a8dba..3497ff5185 100644
--- a/libraries/base/GHC/Stats.hsc
+++ b/libraries/base/GHC/Stats.hsc
@@ -98,7 +98,9 @@ data RTSStats = RTSStats {
-- | Details about the most recent GC
, gc :: GCDetails
- } deriving (Read, Show)
+ } deriving ( Read -- ^ @since 4.10.0.0
+ , Show -- ^ @since 4.10.0.0
+ )
--
-- | Statistics about a single GC. This is a mirror of the C @struct
@@ -135,7 +137,9 @@ data GCDetails = GCDetails {
, gcdetails_cpu_ns :: RtsTime
-- | The time elapsed during GC itself
, gcdetails_elapsed_ns :: RtsTime
- } deriving (Read, Show)
+ } deriving ( Read -- ^ @since 4.10.0.0
+ , Show -- ^ @since 4.10.0.0
+ )
-- | Time values from the RTS, using a fixed resolution of nanoseconds.
type RtsTime = Int64
diff --git a/libraries/base/GHC/Unicode.hs b/libraries/base/GHC/Unicode.hs
index 0e2ce4c0ef..1b8cd0534a 100644
--- a/libraries/base/GHC/Unicode.hs
+++ b/libraries/base/GHC/Unicode.hs
@@ -7,7 +7,7 @@
-- Module : GHC.Unicode
-- Copyright : (c) The University of Glasgow, 2003
-- License : see libraries/base/LICENSE
---
+--
-- Maintainer : cvs-ghc@haskell.org
-- Stability : internal
-- Portability : non-portable (GHC extensions)
@@ -129,7 +129,13 @@ data GeneralCategory
| Surrogate -- ^ Cs: Other, Surrogate
| PrivateUse -- ^ Co: Other, Private Use
| NotAssigned -- ^ Cn: Other, Not Assigned
- deriving (Show, Eq, Ord, Enum, Bounded, Ix)
+ deriving ( Show -- ^ @since 2.01
+ , Eq -- ^ @since 2.01
+ , Ord -- ^ @since 2.01
+ , Enum -- ^ @since 2.01
+ , Bounded -- ^ @since 2.01
+ , Ix -- ^ @since 2.01
+ )
-- | The Unicode general category of the character. This relies on the
-- 'Enum' instance of 'GeneralCategory', which must remain in the
@@ -394,4 +400,3 @@ foreign import ccall unsafe "u_towtitle"
foreign import ccall unsafe "u_gencat"
wgencat :: Int -> Int
-