ghc-7.0.3: The GHC API

IOEnv

Synopsis

Documentation

data IOEnv env a Source

module MonadUtils

getEnv :: IOEnv env envSource

setEnv :: env' -> IOEnv env' a -> IOEnv env aSource

Perform a computation with a different environment

updEnv :: (env -> env') -> IOEnv env' a -> IOEnv env aSource

Perform a computation with an altered environment

runIOEnv :: env -> IOEnv env a -> IO aSource

fixM :: (a -> IOEnv env a) -> IOEnv env aSource

data IORef a Source

A mutable variable in the IO monad

Instances

newMutVar :: a -> IOEnv env (IORef a)Source

writeMutVar :: IORef a -> a -> IOEnv env ()Source

updMutVar :: IORef a -> (a -> a) -> IOEnv env ()Source

atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env bSource

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 bSource

Strict variant of atomicUpdMutVar.