ghc-lib-9.10.1.20241103: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Tc.Validity

Synopsis

Documentation

data Rank #

Instances

Instances details
Outputable Rank 
Instance details

Defined in GHC.Tc.Types.Rank

Methods

ppr :: Rank -> SDoc #

checkFamPatBinders Source #

Arguments

:: TyCon 
-> [TcTyVar]

Bound on LHS of family instance

-> TyVarSet

non-user-written tyvars

-> [TcType]

LHS patterns

-> TcType

RHS

-> 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].

checkTyFamEqnValidityInfo :: TyCon -> TyFamEqnValidityInfo -> TcM () Source #

Perform scoping check on a type family equation.

See TyFamEqnValidityInfo.

checkValidTyFamEqn Source #

Arguments

:: TyCon

of the type family

-> [Type]

Type patterns

-> Type

Rhs

-> 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.)

checkValidAssocTyFamDeflt Source #

Arguments

:: TyCon

of the type family

-> [Type]

Type patterns

-> 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.

checkConsistentFamInst Source #

Arguments

:: AssocInstInfo 
-> TyCon

Family tycon

-> CoAxBranch 
-> TcM ()