GHC.Tc.Types.BasicTypes

ghc-lib-parser-9.10.1.20250103: 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] #

type TcId = Id #

data TcBinder #

Constructors

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

#### Instances

Instances details

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

# Signatures

type TcSigFun = Name -> Maybe TcSigInfo #

data TcSigInfo #

Constructors

TcIdSig TcIdSig |
TcPatSynSig TcPatSynSig |

#### Instances

Instances details

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

data TcIdSig #

Constructors

TcCompleteSig TcCompleteSig |
TcPartialSig TcPartialSig |

#### Instances

Instances details

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

data TcCompleteSig #

Constructors

CSig |
Fields sig_bndr :: TcId sig_ctxt :: UserTypeCtxt sig_loc :: SrcSpan

#### Instances

Instances details

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

data TcPartialSig #

Constructors

PSig |
Fields psig_name :: Name psig_hs_ty :: LHsSigWcType GhcRn psig_ctxt :: UserTypeCtxt psig_loc :: SrcSpan

#### Instances

Instances details

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

data TcPatSynSig #

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 # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcPatSynSig -> SDoc #

data TcIdSigInst #

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 # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcIdSigInst -> SDoc #

isPartialSig :: TcIdSigInst -> Bool #

hasCompleteSig :: TcSigFun -> Name -> Bool #

No signature or a partial signature

tcSigInfoName :: TcSigInfo -> Name #

tcIdSigLoc :: TcIdSig -> SrcSpan #

completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId #

# TcTyThing

data TcTyThing #

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 # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: TcTyThing -> SDoc #

data IdBindingInfo #

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 # |
Instance details Defined in GHC.Tc.Types.BasicTypes Methods ppr :: IdBindingInfo -> SDoc #

data IsGroupClosed #

IsGroupClosed describes a group of mutually-recursive bindings

Constructors

IsGroupClosed (NameEnv RhsNames) ClosedTypeId |

type RhsNames = NameSet #

type ClosedTypeId = Bool #

tcTyThingCategory :: TcTyThing -> String #

tcTyThingTyCon_maybe :: TcTyThing -> Maybe TyCon #

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

pprTcTyThingCategory :: TcTyThing -> SDoc #