Safe Haskell | None |
---|---|
Language | GHC2021 |
ConIO.MonadSTM
Documentation
class Monad m => MonadSTM (m :: Type -> Type) where Source #
MonadSTM
is a class for all monads which can do STM
actions.
Keep in mind that while some monads (e.g. IO
) can do STM
, your STM
actions may not
be executed atomically
if you run them all in the IO
monad. Keep them together in STM
and
then use one liftSTM
to lift them to the IO
monad.
Minimal complete definition
Methods
liftSTM :: STM a -> m a Source #
Lift STM
into the monad m
.
Keep in mind that liftSTM
may lose atomicity. `liftSTM action1 >> liftSTM action2` might not be atomic, depending on the monad m
. Use `liftSTM (action1 >> action2)` instead.
liftSTM_IO :: STM a -> IO a -> m a Source #