Copyright | (c) The University of Glasgow 2004 |
---|---|
License | BSD-style (see the file libraries/base/LICENSE) |
Maintainer | libraries@haskell.org |
Stability | experimental |
Portability | non-portable (requires STM) |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Software Transactional Memory: a modular composable concurrency abstraction. See
- Composable memory transactions, by Tim Harris, Simon Marlow, Simon Peyton Jones, and Maurice Herlihy, in ACM Conference on Principles and Practice of Parallel Programming 2005. https://www.microsoft.com/en-us/research/publication/composable-memory-transactions/
This module only defines the STM
monad; you probably want to
import Control.Concurrent.STM (which exports Control.Monad.STM).
Note that invariant checking (namely the always
and alwaysSucceeds
functions) has been removed. See ticket #14324 and
the removal proposal.
Existing users are encouraged to encapsulate their STM operations in safe
abstractions which can perform the invariant checking without help from the
runtime system.
Documentation
Instances
Alternative STM # | |
Applicative STM # | |
Functor STM # | |
Monad STM # | |
MonadPlus STM # | |
MonadFix STM Source # | Since: stm-2.3 |
Defined in Control.Monad.STM | |
MArray TArray e STM Source # | |
Defined in Control.Concurrent.STM.TArray getBounds :: Ix i => TArray i e -> STM (i, i) Source # getNumElements :: Ix i => TArray i e -> STM Int Source # newArray :: Ix i => (i, i) -> e -> STM (TArray i e) Source # newArray_ :: Ix i => (i, i) -> STM (TArray i e) Source # unsafeNewArray_ :: Ix i => (i, i) -> STM (TArray i e) Source # unsafeRead :: Ix i => TArray i e -> Int -> STM e Source # unsafeWrite :: Ix i => TArray i e -> Int -> e -> STM () Source # | |
Monoid a => Monoid (STM a) # | |
Semigroup a => Semigroup (STM a) # | |
atomically :: STM a -> IO a #
check :: Bool -> STM () Source #
Check that the boolean condition is true and, if not, retry
.
In other words, check b = unless b retry
.
Since: stm-2.1.1