ghc-7.8.4: The GHC API

Safe Haskell | None
Language | Haskell98

IOEnv

Synopsis

- data IOEnv env a
- module MonadUtils
- failM :: IOEnv env a
- failWithM :: String -> IOEnv env a
- data IOEnvFailure = IOEnvFailure
- getEnv :: IOEnv env env
- setEnv :: env' -> IOEnv env' a -> IOEnv env a
- updEnv :: (env -> env') -> IOEnv env' a -> IOEnv env a
- runIOEnv :: env -> IOEnv env a -> IO a
- unsafeInterleaveM :: IOEnv env a -> IOEnv env a
- uninterruptibleMaskM_ :: IOEnv env a -> IOEnv env a
- tryM :: IOEnv env r -> IOEnv env (Either IOEnvFailure r)
- tryAllM :: IOEnv env r -> IOEnv env (Either SomeException r)
- tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)
- fixM :: (a -> IOEnv env a) -> IOEnv env a
- data IORef a :: * -> *
- newMutVar :: a -> IOEnv env (IORef a)
- readMutVar :: IORef a -> IOEnv env a
- writeMutVar :: IORef a -> a -> IOEnv env ()
- updMutVar :: IORef a -> (a -> a) -> IOEnv env ()
- atomicUpdMutVar :: IORef a -> (a -> (a, b)) -> IOEnv env b
- atomicUpdMutVar' :: IORef a -> (a -> (a, b)) -> IOEnv env b

# Documentation

data IOEnv env a

Instances

MonadPlus IO => Alternative (IOEnv env) |
Monad (IOEnv m) |
Functor (IOEnv m) |
MonadPlus IO => MonadPlus (IOEnv env) |
Applicative (IOEnv m) |
Quasi (IOEnv (Env TcGblEnv TcLclEnv)) |
MonadIO (IOEnv env) |
MonadUnique (IOEnv (Env gbl lcl)) |
ContainsModule env => HasModule (IOEnv env) |
ContainsDynFlags env => HasDynFlags (IOEnv env) |
MonadThings (IOEnv (Env TcGblEnv TcLclEnv)) |

module MonadUtils

failM :: IOEnv env a

failWithM :: String -> IOEnv env a

data IOEnvFailure

Constructors

IOEnvFailure |

Instances

Show IOEnvFailure |
Exception IOEnvFailure |
Typeable * IOEnvFailure |

getEnv :: IOEnv env env

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

Perform a computation with a different environment

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

Perform a computation with an altered environment

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

unsafeInterleaveM :: IOEnv env a -> IOEnv env a

uninterruptibleMaskM_ :: IOEnv env a -> IOEnv env a

tryM :: IOEnv env r -> IOEnv env (Either IOEnvFailure r)

tryAllM :: IOEnv env r -> IOEnv env (Either SomeException r)

tryMostM :: IOEnv env r -> IOEnv env (Either SomeException r)

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

data IORef a :: * -> * Source

A mutable variable in the `IO` monad

Instances

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

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

readMutVar :: IORef a -> IOEnv env a

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

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

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

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

Strict variant of `atomicUpdMutVar`.