summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Conc/Sync.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Conc/Sync.hs')
-rw-r--r--libraries/base/GHC/Conc/Sync.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs
index 2a5164b798..5476950ec7 100644
--- a/libraries/base/GHC/Conc/Sync.hs
+++ b/libraries/base/GHC/Conc/Sync.hs
@@ -145,6 +145,7 @@ This misfeature will hopefully be corrected at a later date.
-}
+-- | @since 4.2.0.0
instance Show ThreadId where
showsPrec d t =
showString "ThreadId " .
@@ -165,12 +166,14 @@ cmpThread t1 t2 =
0 -> EQ
_ -> GT -- must be 1
+-- | @since 4.2.0.0
instance Eq ThreadId where
t1 == t2 =
case t1 `cmpThread` t2 of
EQ -> True
_ -> False
+-- | @since 4.2.0.0
instance Ord ThreadId where
compare = cmpThread
@@ -625,9 +628,11 @@ newtype STM a = STM (State# RealWorld -> (# State# RealWorld, a #))
unSTM :: STM a -> (State# RealWorld -> (# State# RealWorld, a #))
unSTM (STM a) = a
+-- | @since 4.3.0.0
instance Functor STM where
fmap f x = x >>= (pure . f)
+-- | @since 4.8.0.0
instance Applicative STM where
{-# INLINE pure #-}
{-# INLINE (*>) #-}
@@ -635,6 +640,7 @@ instance Applicative STM where
(<*>) = ap
m *> k = thenSTM m k
+-- | @since 4.3.0.0
instance Monad STM where
{-# INLINE (>>=) #-}
m >>= k = bindSTM m k
@@ -655,10 +661,12 @@ thenSTM (STM m) k = STM ( \s ->
returnSTM :: a -> STM a
returnSTM x = STM (\s -> (# s, x #))
+-- | @since 4.8.0.0
instance Alternative STM where
empty = retry
(<|>) = orElse
+-- | @since 4.3.0.0
instance MonadPlus STM
-- | Unsafely performs IO in the STM monad. Beware: this is a highly
@@ -769,6 +777,7 @@ always i = alwaysSucceeds ( do v <- i
-- |Shared memory locations that support atomic memory transactions.
data TVar a = TVar (TVar# RealWorld a)
+-- | @since 4.8.0.0
instance Eq (TVar a) where
(TVar tvar1#) == (TVar tvar2#) = isTrue# (sameTVar# tvar1# tvar2#)