HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Tc.Validity

  • 2 types
  • 16 values
  • Packageghc-9.10.3
  • Exports18
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceOrigin.hs
datadata UserTypeCtxt
#
Instances1Eq
valuecheckFamPatBinders
  1. :: TyCon
  2. -> [TcTyVar]

    Bound on LHS of family instance

  3. -> TyVarSet

    non-user-written tyvars

  4. -> [TcType]

    LHS patterns

  5. -> TcType

    RHS

  6. -> TcM ()
#

Check binders for a type or data family declaration.

Specifically, this function checks for:

  • type variables used on the RHS but not bound (explicitly or implicitly) in the LHS,

  • variables bound by a forall in the LHS but not used in the RHS.

See Note [Check type family instance binders].

valuecheckValidTyFamEqn
  1. :: TyCon

    of the type family

  2. -> [Type]

    Type patterns

  3. -> Type

    Rhs

  4. -> TcM ()
#

Do validity checks on a type family equation, including consistency with any enclosing class instance head, termination, and lack of polytypes.

See also the separate checkFamPatBinders which performs scoping checks on a type family equation. (It's separate because it expects TyFamEqnValidityInfo, which comes from a separate place e.g. for associated type defaults.)

valuecheckValidAssocTyFamDeflt
  1. :: TyCon

    of the type family

  2. -> [Type]

    Type patterns

  3. -> TcM ()
#

Checks that an associated type family default:

  1. Only consists of arguments that are bare type variables, and

  2. Has a distinct type variable in each argument.

See Note [Type-checking default assoc decls] in GHC.Tc.TyCl.