HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Driver.Env.Types

  • 2 types
  • Packageghc-9.10.3
  • Exports2
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceTypes.hs
newtypenewtype Hsc a
#

The Hsc monad: Passing an environment and diagnostic state

Instances6Monad, Functor, Applicative, MonadIO, HasLogger, HasDynFlags
  • Monad HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
  • Functor HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
  • Applicative HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
  • MonadIO HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
  • HasLogger HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
  • HasDynFlags HscDefined in ghc-9.10.3 · GHC.Driver.Env.Types
datadata HscEnv
#

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

Instances1ContainsDynFlags