ghc-9.12.0.20241114: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Driver.Env.Types

Synopsis

Documentation

newtype Hsc a Source #

The Hsc monad: Passing an environment and diagnostic state

Constructors

Hsc (HscEnv -> Messages GhcMessage -> IO (a, Messages GhcMessage)) 

Instances

Instances details
HasDynFlags Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

HasLogger Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

Applicative Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

Methods

pure :: a -> Hsc a #

(<*>) :: Hsc (a -> b) -> Hsc a -> Hsc b #

liftA2 :: (a -> b -> c) -> Hsc a -> Hsc b -> Hsc c #

(*>) :: Hsc a -> Hsc b -> Hsc b #

(<*) :: Hsc a -> Hsc b -> Hsc a #

Functor Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

Methods

fmap :: (a -> b) -> Hsc a -> Hsc b #

(<$) :: a -> Hsc b -> Hsc a #

Monad Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

Methods

(>>=) :: Hsc a -> (a -> Hsc b) -> Hsc b #

(>>) :: Hsc a -> Hsc b -> Hsc b #

return :: a -> Hsc a #

MonadIO Hsc Source # 
Instance details

Defined in GHC.Driver.Env.Types

Methods

liftIO :: IO a -> Hsc a #

data HscEnv Source #

HscEnv is like Session, except that some of the fields are immutable. An HscEnv is used to compile a single module from plain Haskell source code (after preprocessing) to either C, assembly or C--. It's also used to store the dynamic linker state to allow for multiple linkers in the same address space. Things like the module graph don't change during a single compilation.

Historical note: "hsc" used to be the name of the compiler binary, when there was a separate driver and compiler. To compile a single module, the driver would invoke hsc on the source code... so nowadays we think of hsc as the layer of the compiler that deals with compiling a single module.

Constructors

HscEnv 

Fields

Instances

Instances details
ContainsDynFlags HscEnv Source # 
Instance details

Defined in GHC.Driver.Env.Types