ghc-7.6.1: The GHC API

Safe HaskellNone

IOEnv

Synopsis

Documentation

data IOEnv env a Source

Instances

Monad (IOEnv m) 
Functor (IOEnv m) 
(Monad (IOEnv env), MonadPlus IO) => MonadPlus (IOEnv env) 
Functor (IOEnv m) => Applicative (IOEnv m) 
Quasi (IOEnv (Env TcGblEnv TcLclEnv)) 
Monad (IOEnv env) => MonadIO (IOEnv env) 
Monad (IOEnv (Env gbl lcl)) => MonadUnique (IOEnv (Env gbl lcl)) 
ContainsDynFlags env => HasDynFlags (IOEnv env) 
MonadThings (IOEnv (Env TcGblEnv TcLclEnv)) 
MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) 

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.