IOEnv

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

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

Quasi TcM # |
Instance details Defined in TcSplice Methods qNewName :: String -> TcM Name Source # qReport :: Bool -> String -> TcM () Source # qRecover :: TcM a -> TcM a -> TcM a Source # qLookupName :: Bool -> String -> TcM (Maybe Name) Source # qReify :: Name -> TcM Info Source # qReifyFixity :: Name -> TcM (Maybe Fixity) Source # qReifyInstances :: Name -> [Type] -> TcM [Dec] Source # qReifyRoles :: Name -> TcM [Role] Source # qReifyAnnotations :: Data a => AnnLookup -> TcM [a] Source # qReifyModule :: Module -> TcM ModuleInfo Source # qReifyConStrictness :: Name -> TcM [DecidedStrictness] Source # qLocation :: TcM Loc Source # qRunIO :: IO a -> TcM a Source # qAddDependentFile :: FilePath -> TcM () Source # qAddTempFile :: String -> TcM FilePath Source # qAddTopDecls :: [Dec] -> TcM () Source # qAddForeignFilePath :: ForeignSrcLang -> String -> TcM () Source # qAddModFinalizer :: Q () -> TcM () Source # qAddCorePlugin :: String -> TcM () Source # qGetQ :: Typeable a => TcM (Maybe a) Source # qPutQ :: Typeable a => a -> TcM () Source # qIsExtEnabled :: Extension -> TcM Bool Source # qExtsEnabled :: TcM [Extension] Source #
Monad (IOEnv m) # |
Instance details Defined in IOEnv Methods (>>=) :: IOEnv m a -> (a -> IOEnv m b) -> IOEnv m b Source # (>>) :: IOEnv m a -> IOEnv m b -> IOEnv m b Source # return :: a -> IOEnv m a Source # fail :: String -> IOEnv m a Source #
Functor (IOEnv m) # |
Instance details Defined in IOEnv Methods fmap :: (a -> b) -> IOEnv m a -> IOEnv m b Source # (<$) :: a -> IOEnv m b -> IOEnv m a Source #
MonadFail (IOEnv m) # |
Instance details Defined in IOEnv Methods fail :: String -> IOEnv m a Source #
Applicative (IOEnv m) # |
Instance details Defined in IOEnv Methods pure :: a -> IOEnv m a Source # (<*>) :: IOEnv m (a -> b) -> IOEnv m a -> IOEnv m b Source # liftA2 :: (a -> b -> c) -> IOEnv m a -> IOEnv m b -> IOEnv m c Source # (*>) :: IOEnv m a -> IOEnv m b -> IOEnv m b Source # (<*) :: IOEnv m a -> IOEnv m b -> IOEnv m a Source #
MonadIO (IOEnv env) # |
Instance details Defined in IOEnv Methods liftIO :: IO a -> IOEnv env a Source #
Alternative (IOEnv env) # |
Instance details Defined in IOEnv Methods empty :: IOEnv env a Source # (<|>) :: IOEnv env a -> IOEnv env a -> IOEnv env a Source # some :: IOEnv env a -> IOEnv env [a] Source # many :: IOEnv env a -> IOEnv env [a] Source #
MonadPlus (IOEnv env) # |
Instance details Defined in IOEnv Methods mzero :: IOEnv env a Source # mplus :: IOEnv env a -> IOEnv env a -> IOEnv env a Source #
ExceptionMonad (IOEnv a) # |
Instance details Defined in IOEnv Methods gcatch :: Exception e => IOEnv a a0 -> (e -> IOEnv a a0) -> IOEnv a a0 # gmask :: ((IOEnv a a0 -> IOEnv a a0) -> IOEnv a b) -> IOEnv a b # gbracket :: IOEnv a a0 -> (a0 -> IOEnv a b) -> (a0 -> IOEnv a c) -> IOEnv a c # gfinally :: IOEnv a a0 -> IOEnv a b -> IOEnv a a0 #
MonadUnique (IOEnv (Env gbl lcl)) # |
Instance details Defined in TcRnMonad Methods getUniqueSupplyM :: IOEnv (Env gbl lcl) UniqSupply # getUniqueM :: IOEnv (Env gbl lcl) Unique # getUniquesM :: IOEnv (Env gbl lcl) [Unique] #
ContainsModule env => HasModule (IOEnv env) # |
Instance details Defined in IOEnv Methods getModule :: IOEnv env Module #
ContainsDynFlags env => HasDynFlags (IOEnv env) # |
Instance details Defined in IOEnv Methods getDynFlags :: IOEnv env DynFlags #
MonadThings (IOEnv (Env TcGblEnv TcLclEnv)) # |
Instance details Defined in TcEnv Methods lookupThing :: Name -> IOEnv (Env TcGblEnv TcLclEnv) TyThing # lookupId :: Name -> IOEnv (Env TcGblEnv TcLclEnv) Id # lookupDataCon :: Name -> IOEnv (Env TcGblEnv TcLclEnv) DataCon # lookupTyCon :: Name -> IOEnv (Env TcGblEnv TcLclEnv) TyCon #
MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) # |
Instance details Defined in DsMonad Methods lookupThing :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyThing # lookupId :: Name -> IOEnv (Env DsGblEnv DsLclEnv) Id # lookupDataCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) DataCon # lookupTyCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyCon #

module MonadUtils

failM :: IOEnv env a #

failWithM :: String -> IOEnv env a #

data IOEnvFailure #

Constructors

IOEnvFailure |

Instances

Show IOEnvFailure # |
Instance details Defined in IOEnv Methods showsPrec :: Int -> IOEnvFailure -> ShowS Source # show :: IOEnvFailure -> String Source # showList :: [IOEnvFailure] -> ShowS Source #
Exception IOEnvFailure # |
Instance details Defined in IOEnv Methods toException :: IOEnvFailure -> SomeException Source # fromException :: SomeException -> Maybe IOEnvFailure Source # displayException :: IOEnvFailure -> String Source #

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

NFData1 IORef | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> IORef a -> () Source #
Eq (IORef a) | ^ Pointer equality. Since: base-4.1.0.0
Instance details Defined in GHC.IORef Methods (==) :: IORef a -> IORef a -> Bool # (/=) :: IORef a -> IORef a -> Bool #
NFData (IORef a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0
Instance details Defined in Control.DeepSeq Methods rnf :: IORef a -> () Source #

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