ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Tc.Gen.Sig

Synopsis

- data TcSigInfo
  - = TcIdSig TcIdSigInfo
  - | TcPatSynSig TcPatSynInfo
- data TcIdSigInfo
  - = CompleteSig {
    - sig_bndr :: TcId
    - sig_ctxt :: UserTypeCtxt
    - sig_loc :: SrcSpan
    }
  - | PartialSig {
    - psig_name :: Name
    - psig_hs_ty :: LHsSigWcType GhcRn
    - sig_ctxt :: UserTypeCtxt
    - sig_loc :: SrcSpan
    }
- data TcIdSigInst
- data TcPatSynInfo = TPSI {
  - 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
  }
- type TcSigFun = Name -> Maybe TcSigInfo
- isPartialSig :: TcIdSigInst -> Bool
- hasCompleteSig :: TcSigFun -> Name -> Bool
- tcIdSigName :: TcIdSigInfo -> Name
- tcSigInfoName :: TcSigInfo -> Name
- completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId
- isCompleteHsSig :: LHsSigWcType GhcRn -> Bool
- lhsSigWcTypeContextSpan :: LHsSigWcType GhcRn -> ReportRedundantConstraints
- lhsSigTypeContextSpan :: LHsSigType GhcRn -> ReportRedundantConstraints
- tcTySigs :: [LSig GhcRn] -> TcM ([TcId], TcSigFun)
- tcUserTypeSig :: SrcSpan -> LHsSigWcType GhcRn -> Maybe Name -> TcM TcIdSigInfo
- completeSigFromId :: UserTypeCtxt -> Id -> TcIdSigInfo
- tcInstSig :: TcIdSigInfo -> TcM TcIdSigInst
- type TcPragEnv = NameEnv [LSig GhcRn]
- emptyPragEnv :: TcPragEnv
- lookupPragEnv :: TcPragEnv -> Name -> [LSig GhcRn]
- extendPragEnv :: TcPragEnv -> (Name, LSig GhcRn) -> TcPragEnv
- mkPragEnv :: [LSig GhcRn] -> LHsBinds GhcRn -> TcPragEnv
- tcSpecPrags :: Id -> [LSig GhcRn] -> TcM [LTcSpecPrag]
- tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper
- tcImpPrags :: [LSig GhcRn] -> TcM [LTcSpecPrag]
- addInlinePrags :: TcId -> [LSig GhcRn] -> TcM TcId
- addInlinePragArity :: Arity -> LSig GhcRn -> LSig GhcRn

# Documentation

data TcSigInfo Source #

Constructors

TcIdSig TcIdSigInfo |
TcPatSynSig TcPatSynInfo |

#### Instances

Instances details

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

data TcIdSigInfo Source #

Constructors

CompleteSig |

Fields

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

PartialSig |

Fields

- psig_name :: Name
- psig_hs_ty :: LHsSigWcType GhcRn
- sig_ctxt :: UserTypeCtxt
- sig_loc :: SrcSpan

#### Instances

Instances details

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

data TcIdSigInst Source #

#### Instances

Instances details

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

data TcPatSynInfo Source #

Constructors

TPSI |

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

type TcSigFun = Name -> Maybe TcSigInfo Source #

isPartialSig :: TcIdSigInst -> Bool Source #

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

No signature or a partial signature

tcIdSigName :: TcIdSigInfo -> Name Source #

tcSigInfoName :: TcSigInfo -> Name Source #

completeSigPolyId_maybe :: TcSigInfo -> Maybe TcId Source #

isCompleteHsSig :: LHsSigWcType GhcRn -> Bool Source #

If there are no wildcards, return a LHsSigWcType

lhsSigWcTypeContextSpan :: LHsSigWcType GhcRn -> ReportRedundantConstraints Source #

Find the location of the top-level context of a HsType. For example:

      forall a b. (Eq a, Ord b) => blah
                  ^^^^^^^^^^^^^

If there is none, return Nothing

lhsSigTypeContextSpan :: LHsSigType GhcRn -> ReportRedundantConstraints Source #

tcTySigs :: [LSig GhcRn] -> TcM ([TcId], TcSigFun) Source #

tcUserTypeSig :: SrcSpan -> LHsSigWcType GhcRn -> Maybe Name -> TcM TcIdSigInfo Source #

completeSigFromId :: UserTypeCtxt -> Id -> TcIdSigInfo Source #

tcInstSig :: TcIdSigInfo -> TcM TcIdSigInst Source #

type TcPragEnv = NameEnv [LSig GhcRn] Source #

emptyPragEnv :: TcPragEnv Source #

lookupPragEnv :: TcPragEnv -> Name -> [LSig GhcRn] Source #

extendPragEnv :: TcPragEnv -> (Name, LSig GhcRn) -> TcPragEnv Source #

mkPragEnv :: [LSig GhcRn] -> LHsBinds GhcRn -> TcPragEnv Source #

tcSpecPrags :: Id -> [LSig GhcRn] -> TcM [LTcSpecPrag] Source #

tcSpecWrapper :: UserTypeCtxt -> TcType -> TcType -> TcM HsWrapper Source #

tcImpPrags :: [LSig GhcRn] -> TcM [LTcSpecPrag] Source #

addInlinePrags :: TcId -> [LSig GhcRn] -> TcM TcId Source #

addInlinePragArity :: Arity -> LSig GhcRn -> LSig GhcRn Source #