HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

datadata EqRel

A choice of equality relation. This is separate from the type Role because Phantom does not define a (non-trivial) equality relation.

Instances3Eq, Ord, Outputable
  • Eq EqRelDefined in ghc-10.0.0.20260917 · GHC.Core.Predicate
  • Ord EqRelDefined in ghc-10.0.0.20260917 · GHC.Core.Predicate
  • Outputable EqRelDefined in ghc-10.0.0.20260917 · GHC.Core.Predicate
valueisEqPred :: PredType -> Bool

Does this type classify a core (unlifted) Coercion? At either role nominal or representational (t1 ~# t2) or (t1 ~R# t2) See Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep

valuemkNomEqPred :: Type -> Type -> Type

Creates a primitive nominal type equality predicate. t1 ~# t2 Invariant: the types are not Coercions

valuemkReprEqPred :: Type -> Type -> Type

Creates a primitive representational type equality predicate. t1 ~R# t2 Invariant: the types are not Coercions

Is the type *guaranteed* to determine the value? Might say No even if the type does determine the value. See Note [Type determines value]

valuemightMentionIP
  1. :: (Type -> Bool)

    predicate on the string

  2. -> (Type -> Bool)

    predicate on the type

  3. -> Class
  4. -> [Type]
  5. -> Bool

mightMentionIP str_cond ty_cond cls tys returns True if:

  • cls tys is of the form IP str ty, where str_cond str and ty_cond ty are both True,

  • or any superclass of cls tys has this property.

See Note [Local implicit parameters]

valuedecomposeIPPred :: Type -> (Id, [Type])

Take a type (IP sym ty), where IP is the built in IP class and return (ip, MkIP, [sym,ty]), where ip is the class-op for class IP MkIP is the data constructor for class IP

Well-scoped free variables

valuescopedSort :: [Var] -> [Var]

Do a topological sort on a list of tyvars, so that binders occur before occurrences E.g. given [ a::k, k::Type, b::k ] it'll return a well-scoped list [ k::Type, a::k, b::k ].

This is a deterministic sorting operation (that is, doesn't depend on Uniques).

It is also meant to be stable: that is, variables should not be reordered unnecessarily. This is specified in Note [ScopedSort] See also Note [Ordering of implicit variables] in GHC.Rename.HsType

Is a type a canonical LHS? That is, is it a tyvar or an exactly-saturated type family application? Does not look through type synonyms.