Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
The specification of STM
An expression of type IOSpec
corresponds to an STMS
aIO
computation that may use atomically
and returns a value of type
a
.
By itself, STMS
is not terribly useful. You will probably want
to use IOSpec (ForkS :+: STMS)
.
Atomically
atomically :: STMS :<: f => STM a -> IOSpec f a Source #
The atomically
function atomically executes an STM
action.
The STM monad
newTVar :: Typeable a => a -> STM (TVar a) Source #
The newTVar
function creates a new transactional variable.
readTVar :: Typeable a => TVar a -> STM a Source #
The readTVar
function reads the value stored in a
transactional variable.
writeTVar :: Typeable a => TVar a -> a -> STM () Source #
The writeTVar
function overwrites the value stored in a
transactional variable.