GHC.Data.IOEnv
The IO Monad with an environment
The environment is passed around as a Reader monad but as its in the IO monad, mutable references can be used for updating state.
Documentation
Instances
module GHC.Utils.Monad
data IOEnvFailure Source #
Constructors
IOEnvFailure |
Instances
Exception IOEnvFailure Source # | |
Defined in GHC.Data.IOEnv Methods toException :: IOEnvFailure -> SomeException Source # fromException :: SomeException -> Maybe IOEnvFailure Source # | |
Show IOEnvFailure Source # | |
Defined in GHC.Data.IOEnv |
setEnv :: env' -> IOEnv env' a -> IOEnv env a Source #
Perform a computation with a different environment
updEnv :: (env -> env') -> IOEnv env' a -> IOEnv env a Source #
Perform a computation with an altered environment
unsafeInterleaveM :: IOEnv env a -> IOEnv env a Source #
uninterruptibleMaskM_ :: IOEnv env a -> IOEnv env a Source #
A mutable variable in the IO
monad
Instances
NFData1 IORef | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
NFData (IORef a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
Eq (IORef a) | Pointer equality. Since: base-4.0.0.0 |
readMutVar :: IORef a -> IOEnv env a Source #
writeMutVar :: IORef a -> a -> IOEnv env () Source #
atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b Source #
Atomically update the reference. Does not force the evaluation of the
new variable contents. For strict update, use atomicUpdMutVar'
.
atomicUpdMutVar' :: IORef a -> (a -> (a, b)) -> IOEnv env b Source #
Strict variant of atomicUpdMutVar
.