ghc-7.7.20130829: The GHC API

Safe HaskellNone

IOEnv

Synopsis

Documentation

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

Eq (IORef a) 
Typeable (* -> *) IORef 

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.