A predicate in the solver. The solver tries to prove Wanted predicates from Given ones.
Moduleghc-9.14.1GHC2021
GHC.Core.Predicate
- 4 types
- 49 values
- Packageghc-9.14.1
- Exports53
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourcePredicate.hs
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
Get the equality relation relevant for a pred type Returns NomEq for dictionary predicates, etc
Creates a primitive nominal type equality predicate. t1 ~# t2 Invariant: the types are not Coercions
Creates a primitive representational type equality predicate. t1 ~R# t2 Invariant: the types are not Coercions
Makes a lifted equality predicate at the given role
Makes a lifted equality predicate at the given role
Is the type *guaranteed* to determine the value? Might say No even if the type does determine the value. See Note [Type determines value]
mightMentionIP mightMentionIP str_cond ty_cond cls tys returns True if:
cls tysis of the formIP str ty, wherestr_cond strandty_cond tyare bothTrue,or any superclass of
cls tyshas this property.
See Note [Local implicit parameters]
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
Is a type a CallStack?
Is a PredType a CallStack implicit parameter?
If so, return the name of the parameter.
Is a PredType an ExceptionContext implicit parameter?
If so, return the name of the parameter.
Is a type an ExceptionContext?
Decomposes a predicate if it is an implicit parameter. Does not look in superclasses. See also [Local implicit parameters].
Dictionary Identifier
Well-scoped free variables
9 declarationsDo 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
Get the free vars of a type in scoped order
Get the free vars of types in scoped order
A CanEqLHS is a type that can appear on the left of a canonical equality: a type variable or exactly-saturated type family application.
Instances1Outputable
Outputable CanEqLHSDefined in ghc-9.14.1 · GHC.Core.Predicate
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.
Retrieve the kind of a CanEqLHS
Are two CanEqLHSs equal?