Moduleghc-10.0.0.20260917GHC2024
GHC.Tc.Gen.HsType
Typechecking user-specified MonoTypes
- 6 types
- 64 values
- Packageghc-10.0.0.20260917
- Exports70
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceHsType.hs
Typecheck the class in a default declaration, checking that:
it is indeed a class (not e.g. a type family),
that the class expects some invisible arguments followed by a single visible argument.
Like tcHsSigType, but for the ...deriving( C ty1 ty2 ) clause
Returns a class constraint with the last argument missing, and the expected kind of the remaining argument.
E.g.:
class C (a::*) (b::k->k)
data T a b = ... deriving( C Int )
This function returns (C, [k], [k, Int], k->k).
Return values are fully zonked
tcDerivStrategy :: Maybe (LDerivStrategy GhcRn)The deriving strategy
-> TcM (Maybe (LDerivStrategy GhcTc), [TcTyVar])The typechecked deriving strategy and the tyvars that it binds (if using ViaStrategy).
Typecheck a deriving strategy. For most deriving strategies, this is a
no-op, but for the via strategy, this requires typechecking the via type.
Type-check a visible type application
UserTypeCtxt describes the origin of the polymorphic type in the places where we need an expression to have that type
Constructors
FunSigCtxt Name ReportRedundantConstraintsInfSigCtxt NameExprSigCtxt ReportRedundantConstraintsKindSigCtxtStandaloneKindSigCtxt NameTypeAppCtxtConArgCtxt NameTySynCtxt NamePatSynCtxt NamePatSigCtxtForSigCtxt NameDefaultDeclCtxtInstDeclCtxt BoolSpecInstCtxtGenSigCtxtGhciCtxt BoolClassSCCtxt NameSigmaCtxtDataTyCtxt NameDerivClauseCtxtTyVarBndrKindCtxt NameRuleBndrTypeCtxt NameDataKindCtxt NameTySynKindCtxt NameTyFamResKindCtxt Name
Instances1Eq
Eq UserTypeCtxtDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ErrCtxt
Skolemise the HsTyVarBndrs in an HsForAllTelescope with the supplied
TcTyMode.
Bring into scope the binders of a PolyTcTyCon Used for the type variables of a type or class decl in the "kind checking" and "type checking" pass, but not in the initial-kind run.
Constructors
Instances1Outputable
Outputable SAKS_or_CUSKDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.HsType
Describes the kind expected in a certain context.
Instances1Outputable
Outputable ContextKindDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.HsType
kcDeclHeader :: InitialKindStrategy-> Nameof the thing being checked
-> TyConFlavour TyConWhat sort of TyCon is being checked
-> LHsQTyVars GhcRnBinders in the header
-> TcM ContextKindThe result kind
-> TcM TcTyConA suitably-kinded TcTyCon
Specialised version of
kindGeneralizeSome, but with empty WantedConstraints, so no filtering is needed i.e. kindGeneraliseAll = kindGeneralizeSome emptyWC
Checks that the return kind in a data declaration's kind signature is permissible. There are three cases:
If dealing with a data, newtype, data instance, or newtype instance
declaration, check that the return kind is Type.
If the declaration is a newtype or newtype instance and the
UnliftedNewtypes extension is enabled, this check is slightly relaxed so
that a return kind of the form TYPE r (for some r) is permitted.
See Note [Implementation of UnliftedNewtypes] in GHC.Tc.TyCl.
If dealing with a data family declaration, check that the return kind is
either of the form:
TYPE r(for somer), ork(wherekis a bare kind variable; see #12369)
See also Note [Datatype return kinds] in GHC.Tc.TyCl
A description of whether something is a
dataornewtype(DataDeclSort)data instanceornewtype instance(DataInstanceSort)data family(DataFamilySort)
At present, this data type is only consumed by checkDataKindSig.
Checks that the result kind of a class is exactly Constraint, rejecting
type synonyms and type families that reduce to Constraint. See #16826.
Instances1Outputable
Outputable HoleModeDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.HsType