summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Conc
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Conc')
-rw-r--r--libraries/base/GHC/Conc/Sync.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs
index db6f841851..83934fe05a 100644
--- a/libraries/base/GHC/Conc/Sync.hs
+++ b/libraries/base/GHC/Conc/Sync.hs
@@ -626,19 +626,19 @@ unSTM :: STM a -> (State# RealWorld -> (# State# RealWorld, a #))
unSTM (STM a) = a
instance Functor STM where
- fmap f x = x >>= (return . f)
+ fmap f x = x >>= (pure . f)
instance Applicative STM where
- pure = return
+ {-# INLINE pure #-}
+ {-# INLINE (*>) #-}
+ pure x = returnSTM x
(<*>) = ap
+ m *> k = thenSTM m k
instance Monad STM where
- {-# INLINE return #-}
- {-# INLINE (>>) #-}
{-# INLINE (>>=) #-}
- m >> k = thenSTM m k
- return x = returnSTM x
m >>= k = bindSTM m k
+ (>>) = (*>)
bindSTM :: STM a -> (a -> STM b) -> STM b
bindSTM (STM m) k = STM ( \s ->