ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.HsToCore.Types

Description

Various types used during desugaring.

Synopsis

- type DsM = TcRnIf DsGblEnv DsLclEnv
- data DsLclEnv = DsLclEnv {
  - dsl_meta :: DsMetaEnv
  - dsl_loc :: RealSrcSpan
  - dsl_nablas :: Nablas
  }
- data DsGblEnv = DsGblEnv {
  - ds_mod :: Module
  - ds_fam_inst_env :: FamInstEnv
  - ds_gbl_rdr_env :: GlobalRdrEnv
  - ds_name_ppr_ctx :: NamePprCtx
  - ds_msgs :: IORef (Messages DsMessage)
  - ds_if_env :: (IfGblEnv, IfLclEnv)
  - ds_complete_matches :: CompleteMatches
  - ds_cc_st :: IORef CostCentreState
  - ds_next_wrapper_num :: IORef (ModuleEnv Int)
  }
- type DsMetaEnv = NameEnv DsMetaVal
- data DsMetaVal
  - = DsBound Id
  - | DsSplice (HsExpr GhcTc)
- type CompleteMatches = [CompleteMatch]

# Documentation

type DsM = TcRnIf DsGblEnv DsLclEnv Source #

Desugaring monad. See also `TcM`.

data DsLclEnv Source #

Local state of the desugarer, extended as we lexically descend

Constructors

DsLclEnv |

Fields

- dsl_meta :: DsMetaEnv

  Template Haskell bindings

- dsl_loc :: RealSrcSpan

  To put in pattern-matching error msgs

- dsl_nablas :: Nablas

  See Note [Long-distance information] in GHC.HsToCore.Pmc. The set of reaching values Nablas is augmented as we walk inwards, refined through each pattern match in turn

#### Instances

Instances details

MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) Source # |
Instance details Defined in GHC.HsToCore.Monad Methods lookupThing :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyThing Source # lookupId :: Name -> IOEnv (Env DsGblEnv DsLclEnv) Id Source # lookupDataCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) DataCon Source # lookupTyCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyCon Source #

data DsGblEnv Source #

Global read-only context and state of the desugarer. The statefulness is implemented through `IORef`s.

Constructors

DsGblEnv |

Fields

- ds_mod :: Module
- ds_fam_inst_env :: FamInstEnv
- ds_gbl_rdr_env :: GlobalRdrEnv
- ds_name_ppr_ctx :: NamePprCtx
- ds_msgs :: IORef (Messages DsMessage)
- ds_if_env :: (IfGblEnv, IfLclEnv)
- ds_complete_matches :: CompleteMatches
- ds_cc_st :: IORef CostCentreState
- ds_next_wrapper_num :: IORef (ModuleEnv Int)

  See Note [Generating fresh names for FFI wrappers]

#### Instances

Instances details

ContainsModule DsGblEnv Source # |
Instance details Defined in GHC.HsToCore.Types Methods extractModule :: DsGblEnv -> Module Source #
MonadThings (IOEnv (Env DsGblEnv DsLclEnv)) Source # |
Instance details Defined in GHC.HsToCore.Monad Methods lookupThing :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyThing Source # lookupId :: Name -> IOEnv (Env DsGblEnv DsLclEnv) Id Source # lookupDataCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) DataCon Source # lookupTyCon :: Name -> IOEnv (Env DsGblEnv DsLclEnv) TyCon Source #

type DsMetaEnv = NameEnv DsMetaVal Source #

data DsMetaVal Source #

Constructors

DsBound Id |
DsSplice (HsExpr GhcTc) |

type CompleteMatches = [CompleteMatch] Source #