ghc-7.8.1: The GHC API

Safe HaskellNone
LanguageHaskell98

IOEnv

Synopsis

Documentation

module MonadUtils

failM :: IOEnv env a Source

getEnv :: IOEnv env env Source

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

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

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

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 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.