Constructors
TyVarTy VarVanilla type or kind variable (*never* a coercion variable)
AppTy Type TypeTyConApp TyCon [KindOrType]Application of a TyCon, including newtypes and synonyms. Invariant: saturated applications of
FunTyConmust use FunTy and saturated synonyms must use their own constructors. However, unsaturatedFunTyCons do appear as TyConApps. Parameters:1) Type constructor being applied to.
2) Type arguments. Might not have enough type arguments here to saturate the constructor. Even type synonyms are not necessarily saturated; for example unsaturated type synonyms can appear as the right hand side of a type synonym.
ForAllTy !ForAllTyBinder TypeA Π type. See Note [Why ForAllTy can quantify over a coercion variable] INVARIANT: If the binder is a coercion variable, it must be mentioned in the Type. See Note [Unused coercion variable in ForAllTy]
FunTyFUN m t1 t2 Very common, so an important special case See Note [Function types]
LitTy TyLitType literals are similar to type constructors.
CastTy Type KindCoercionA kind cast. The coercion is always nominal. INVARIANT: The cast is never reflexive (EQ2) INVARIANT: The Type is not a CastTy (use TransCo instead) (EQ3) INVARIANT: The Type is not a ForAllTy over a tyvar (EQ4) See Note [Respecting definitional equality]
CoercionTy CoercionInjection of a Coercion into a type This should only ever be used in the RHS of an AppTy, in the list of a TyConApp, when applying a promoted GADT data constructor