ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Tc.Types.BasicTypes

Contents

- TcBinder
- Signatures
- TcTyThing

Synopsis

- type TcBinderStack = [TcBinder]
- type TcId = Id
- data TcBinder
  - = TcIdBndr TcId TopLevelFlag
  - | TcIdBndr_ExpType Name ExpType TopLevelFlag
  - | TcTvBndr Name TyVar
- type TcSigFun = Name -> Maybe TcSigInfo
- data TcSigInfo
  - = TcIdSig TcIdSig
  - | TcPatSynSig TcPatSynSig
- data TcIdSig
  - = TcCompleteSig TcCompleteSig
  - | TcPartialSig TcPartialSig
- data TcCompleteSig = CSig {
  - sig_bndr :: TcId
  - sig_ctxt :: UserTypeCtxt
  - sig_loc :: SrcSpan
  }
- data TcPartialSig = PSig {
  - psig_name :: Name
  - psig_hs_ty :: LHsSigWcType GhcRn
  - psig_ctxt :: UserTypeCtxt
  - psig_loc :: SrcSpan
  }
- data TcPatSynSig = PatSig {
  - patsig_name :: Name
  - patsig_implicit_bndrs :: [InvisTVBinder]
  - patsig_univ_bndrs :: [InvisTVBinder]
  - patsig_req :: TcThetaType
  - patsig_ex_bndrs :: [InvisTVBinder]
  - patsig_prov :: TcThetaType
  - patsig_body_ty :: TcSigmaType
  }
- data TcIdSigInst = TISI {
  - sig_inst_sig :: TcIdSig
  - sig_inst_skols :: [(Name, InvisTVBinder)]
  - sig_inst_theta :: TcThetaType
  - sig_inst_tau :: TcSigmaType
  - sig_inst_wcs :: [(Name, TcTyVar)]
  - sig_inst_wcx :: Maybe TcType
  }
- isPartialSig :: TcIdSigInst -> Bool
- hasCompleteSig :: TcSigFun -> Name -> Bool
- tcSigInfoName :: TcSigInfo -> Name
- tcIdSigLoc :: TcIdSig -> SrcSpan
- completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId
- data TcTyThing
  - = AGlobal TyThing
  - | ATcId {
    - tct_id :: Id
    - tct_info :: IdBindingInfo
    }
  - | ATyVar Name TcTyVar
  - | ATcTyCon TyCon
  - | APromotionErr PromotionErr
- data IdBindingInfo
  - = NotLetBound
  - | ClosedLet
  - | NonClosedLet RhsNames ClosedTypeId
- data IsGroupClosed = IsGroupClosed (NameEnv RhsNames) ClosedTypeId
- type RhsNames = NameSet
- type ClosedTypeId = Bool
- tcTyThingCategory :: TcTyThing -> String
- tcTyThingTyCon_maybe :: TcTyThing -> Maybe TyCon
- pprTcTyThingCategory :: TcTyThing -> SDoc

# TcBinder

type TcBinderStack = [TcBinder] Source #

type TcId = Id Source #

data TcBinder Source #

Constructors

TcIdBndr TcId TopLevelFlag |
TcIdBndr_ExpType Name ExpType TopLevelFlag |
TcTvBndr Name TyVar |

#### Instances

Instances details

HasOccName TcBinder Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods occName :: TcBinder -> OccName Source #
Outputable TcBinder Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcBinder -> SDoc Source #

# Signatures

type TcSigFun = Name -> Maybe TcSigInfo Source #

data TcSigInfo Source #

Constructors

TcIdSig TcIdSig |
TcPatSynSig TcPatSynSig |

#### Instances

Instances details

Outputable TcSigInfo Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcSigInfo -> SDoc Source #

data TcIdSig Source #

Constructors

TcCompleteSig TcCompleteSig |
TcPartialSig TcPartialSig |

#### Instances

Instances details

Outputable TcIdSig Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcIdSig -> SDoc Source #

data TcCompleteSig Source #

Constructors

CSig |

Fields

- sig_bndr :: TcId
- sig_ctxt :: UserTypeCtxt
- sig_loc :: SrcSpan

#### Instances

Instances details

Outputable TcCompleteSig Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcCompleteSig -> SDoc Source #

data TcPartialSig Source #

Constructors

PSig |

Fields

- psig_name :: Name
- psig_hs_ty :: LHsSigWcType GhcRn
- psig_ctxt :: UserTypeCtxt
- psig_loc :: SrcSpan

#### Instances

Instances details

Outputable TcPartialSig Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcPartialSig -> SDoc Source #

data TcPatSynSig Source #

Constructors

PatSig |

Fields

- patsig_name :: Name
- patsig_implicit_bndrs :: [InvisTVBinder]
- patsig_univ_bndrs :: [InvisTVBinder]
- patsig_req :: TcThetaType
- patsig_ex_bndrs :: [InvisTVBinder]
- patsig_prov :: TcThetaType
- patsig_body_ty :: TcSigmaType

#### Instances

Instances details

Outputable TcPatSynSig Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcPatSynSig -> SDoc Source #

data TcIdSigInst Source #

Constructors

TISI |

Fields

- sig_inst_sig :: TcIdSig
- sig_inst_skols :: [(Name, InvisTVBinder)]
- sig_inst_theta :: TcThetaType
- sig_inst_tau :: TcSigmaType
- sig_inst_wcs :: [(Name, TcTyVar)]
- sig_inst_wcx :: Maybe TcType

#### Instances

Instances details

Outputable TcIdSigInst Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcIdSigInst -> SDoc Source #

isPartialSig :: TcIdSigInst -> Bool Source #

hasCompleteSig :: TcSigFun -> Name -> Bool Source #

No signature or a partial signature

tcSigInfoName :: TcSigInfo -> Name Source #

tcIdSigLoc :: TcIdSig -> SrcSpan Source #

completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId Source #

# TcTyThing

data TcTyThing Source #

A typecheckable thing available in a local context. Could be `AGlobal` `TyThing`, but also lexically scoped variables, etc. See GHC.Tc.Utils.Env for how to retrieve a `TyThing` given a `Name`.

Constructors

AGlobal TyThing |
ATcId |

Fields

- tct_id :: Id
- tct_info :: IdBindingInfo

ATyVar Name TcTyVar |
ATcTyCon TyCon |
APromotionErr PromotionErr |

#### Instances

Instances details

Outputable TcTyThing Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcTyThing -> SDoc Source #

data IdBindingInfo Source #

IdBindingInfo describes how an Id is bound.

It is used for the following purposes: a) for static forms in `checkClosedInStaticForm` and b) to figure out when a nested binding can be generalised, in `decideGeneralisationPlan`.

Constructors

NotLetBound |
ClosedLet |
NonClosedLet RhsNames ClosedTypeId |

#### Instances

Instances details

Outputable IdBindingInfo Source # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: IdBindingInfo -> SDoc Source #

data IsGroupClosed Source #

IsGroupClosed describes a group of mutually-recursive bindings

Constructors

IsGroupClosed (NameEnv RhsNames) ClosedTypeId |

type RhsNames = NameSet Source #

type ClosedTypeId = Bool Source #

tcTyThingCategory :: TcTyThing -> String Source #

tcTyThingTyCon_maybe :: TcTyThing -> Maybe TyCon Source #

Matches on either a global `TyCon` or a `TcTyCon`.

pprTcTyThingCategory :: TcTyThing -> SDoc Source #