HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleghc-9.14.1GHC2021

GHC.Tc.Gen.HsType

Typechecking user-specified MonoTypes

  • 6 types
  • 62 values
  • Packageghc-9.14.1
  • Exports68
  • LanguageGHC2021
  • 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

datadata UserTypeCtxt
#
Instances1Eq
valuebindTyClTyVars :: Name -> ([TcTyConBinder] -> TcKind -> TcM a) -> TcM a
#

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.

  • Specialised version of kindGeneralizeSome, but with empty WantedConstraints, so no filtering is needed i.e. kindGeneraliseAll = kindGeneralizeSome emptyWC

valuecheckDataKindSig :: DataSort -> Kind -> TcM ()
#

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:

  1. TYPE r (for some r), or

  2. k (where k is a bare kind variable; see #12369)

See also Note [Datatype return kinds] in GHC.Tc.TyCl

valuecheckClassKindSig :: Kind -> TcM ()
#

Checks that the result kind of a class is exactly Constraint, rejecting type synonyms and type families that reduce to Constraint. See #16826.