Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lifted STM
operations.
Synopsis
- data STM a
- class (MonadBase STM μ, MonadCatch μ) => MonadSTM μ where
- atomically :: MonadBase IO μ => STM α -> μ α
- retry :: MonadBase STM μ => μ α
- check :: MonadBase STM μ => Bool -> μ ()
- throwSTM :: (Exception e, MonadBase STM μ) => e -> μ α
- catchSTM :: (Exception e, MonadSTM μ) => μ α -> (e -> μ α) -> μ α
Documentation
A monad supporting atomic memory transactions.
Instances
Monad STM | Since: base-4.3.0.0 |
Functor STM | Since: base-4.3.0.0 |
Applicative STM | Since: base-4.8.0.0 |
Alternative STM | Since: base-4.8.0.0 |
MonadPlus STM | Since: base-4.3.0.0 |
MonadSTM STM Source # | |
MonadAbort SomeException STM | |
Defined in Control.Monad.Abort.Class abort :: SomeException -> STM α # | |
MonadRecover SomeException STM | |
Defined in Control.Monad.Abort.Class | |
MonadBase STM STM | |
Defined in Control.Monad.Base | |
MArray TArray e STM | |
Defined in Control.Concurrent.STM.TArray getBounds :: Ix i => TArray i e -> STM (i, i) # getNumElements :: Ix i => TArray i e -> STM Int newArray :: Ix i => (i, i) -> e -> STM (TArray i e) # newArray_ :: Ix i => (i, i) -> STM (TArray i e) # unsafeNewArray_ :: Ix i => (i, i) -> STM (TArray i e) unsafeRead :: Ix i => TArray i e -> Int -> STM e unsafeWrite :: Ix i => TArray i e -> Int -> e -> STM () |
class (MonadBase STM μ, MonadCatch μ) => MonadSTM μ where Source #
Class of monads that have STM
as their base and support composing
alternative (vs retries) actions.
orElse :: μ α -> μ α -> μ α Source #
Equivalent to the first action, unless it retries. It which case the second action is performed in its place.
Instances
MonadSTM STM Source # | |
MonadSTM μ => MonadSTM (MaybeT μ) Source # | |
MonadSTM μ => MonadSTM (IdentityT μ) Source # | |
MonadSTM μ => MonadSTM (FinishT r μ) Source # | |
(Monoid w, MonadSTM μ) => MonadSTM (WriterT w μ) Source # | |
MonadSTM μ => MonadSTM (StateT s μ) Source # | |
MonadSTM μ => MonadSTM (StateT s μ) Source # | |
(Monoid w, MonadSTM μ) => MonadSTM (WriterT w μ) Source # | |
(Monoid w, MonadSTM μ) => MonadSTM (AccumT w μ) Source # | |
MonadSTM μ => MonadSTM (ReaderT w μ) Source # | |
(Monoid w, MonadSTM μ) => MonadSTM (RWST r w s μ) Source # | |
(Monoid w, MonadSTM μ) => MonadSTM (RWST r w s μ) Source # | |
atomically :: MonadBase IO μ => STM α -> μ α Source #
A lifted version of atomically
.