ghc-9.12: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Data.IOEnv

Description

The IO Monad with an environment

The environment is passed around as a Reader monad but as its in the IO monad, mutable references can be used for updating state.

Synopsis

Documentation

data IOEnv env a Source #

Instances

Instances details
Quasi TcM 
Instance details

Defined in GHC.Tc.Gen.Splice

Methods

qNewName :: String -> TcM Name

qReport :: Bool -> String -> TcM ()

qRecover :: TcM a -> TcM a -> TcM a

qLookupName :: Bool -> String -> TcM (Maybe Name)

qReify :: Name -> TcM Info

qReifyFixity :: Name -> TcM (Maybe Fixity)

qReifyType :: Name -> TcM Type

qReifyInstances :: Name -> [Type] -> TcM [Dec]

qReifyRoles :: Name -> TcM [Role]

qReifyAnnotations :: Data a => AnnLookup -> TcM [a]

qReifyModule :: Module -> TcM ModuleInfo

qReifyConStrictness :: Name -> TcM [DecidedStrictness]

qLocation :: TcM Loc

qRunIO :: IO a -> TcM a

qGetPackageRoot :: TcM FilePath

qAddDependentFile :: FilePath -> TcM ()

qAddTempFile :: String -> TcM FilePath

qAddTopDecls :: [Dec] -> TcM ()

qAddForeignFilePath :: ForeignSrcLang -> String -> TcM ()

qAddModFinalizer :: Q () -> TcM ()

qAddCorePlugin :: String -> TcM ()

qGetQ :: Typeable a => TcM (Maybe a)

qPutQ :: Typeable a => a -> TcM ()

qIsExtEnabled :: Extension -> TcM Bool

qExtsEnabled :: TcM [Extension]

qPutDoc :: DocLoc -> String -> TcM ()

qGetDoc :: DocLoc -> TcM (Maybe String)

MonadCatch (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

catch :: (HasCallStack, Exception e) => IOEnv env a -> (e -> IOEnv env a) -> IOEnv env a Source #

MonadMask (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

mask :: HasCallStack => ((forall a. IOEnv env a -> IOEnv env a) -> IOEnv env b) -> IOEnv env b Source #

uninterruptibleMask :: HasCallStack => ((forall a. IOEnv env a -> IOEnv env a) -> IOEnv env b) -> IOEnv env b Source #

generalBracket :: HasCallStack => IOEnv env a -> (a -> ExitCase b -> IOEnv env c) -> (a -> IOEnv env b) -> IOEnv env (b, c) Source #

MonadThrow (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

throwM :: (HasCallStack, Exception e) => e -> IOEnv env a Source #

ContainsDynFlags env => HasDynFlags (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

ContainsHooks env => HasHooks (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

getHooks :: IOEnv env Hooks Source #

MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) Source # 
Instance details

Defined in GHC.HsToCore.Monad

MonadThings (IOEnv (Env TcGblEnv TcLclEnv)) Source # 
Instance details

Defined in GHC.Tc.Utils.Env

MonadUnique (IOEnv (Env gbl lcl)) Source # 
Instance details

Defined in GHC.Tc.Utils.Monad

ContainsModule env => HasModule (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

getModule :: IOEnv env Module Source #

ContainsLogger env => HasLogger (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

getLogger :: IOEnv env Logger Source #

Alternative (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

empty :: IOEnv env a #

(<|>) :: IOEnv env a -> IOEnv env a -> IOEnv env a #

some :: IOEnv env a -> IOEnv env [a] #

many :: IOEnv env a -> IOEnv env [a] #

Applicative (IOEnv m) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

pure :: a -> IOEnv m a #

(<*>) :: IOEnv m (a -> b) -> IOEnv m a -> IOEnv m b #

liftA2 :: (a -> b -> c) -> IOEnv m a -> IOEnv m b -> IOEnv m c #

(*>) :: IOEnv m a -> IOEnv m b -> IOEnv m b #

(<*) :: IOEnv m a -> IOEnv m b -> IOEnv m a #

Functor (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

fmap :: (a -> b) -> IOEnv env a -> IOEnv env b #

(<$) :: a -> IOEnv env b -> IOEnv env a #

Monad (IOEnv m) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

(>>=) :: IOEnv m a -> (a -> IOEnv m b) -> IOEnv m b #

(>>) :: IOEnv m a -> IOEnv m b -> IOEnv m b #

return :: a -> IOEnv m a #

MonadPlus (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

mzero :: IOEnv env a #

mplus :: IOEnv env a -> IOEnv env a -> IOEnv env a #

MonadFail (IOEnv m) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

fail :: String -> IOEnv m a #

MonadFix (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

mfix :: (a -> IOEnv env a) -> IOEnv env a #

MonadIO (IOEnv env) Source # 
Instance details

Defined in GHC.Data.IOEnv

Methods

liftIO :: IO a -> IOEnv env a #

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 #

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

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

data IORef a #

Instances

Instances details
NFData1 IORef Source #

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> IORef a -> () Source #

NFData (IORef a) Source #

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 #

Eq (IORef a) # 
Instance details

Defined in GHC.Internal.IORef

Methods

(==) :: IORef a -> IORef a -> Bool #

(/=) :: IORef a -> IORef a -> Bool #

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

readMutVar :: IORef a -> IOEnv env 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.