ghc-9.12.0.20241114: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Core.TyCo.Compare

Description

Type equality and comparison

Synopsis

Type equality

eqType :: HasCallStack => Type -> Type -> Bool Source #

Type equality comparing both visible and invisible arguments, expanding synonyms and respecting multiplicities.

eqTypeX :: HasCallStack => RnEnv2 -> Type -> Type -> Bool Source #

Compare types with respect to a (presumably) non-empty RnEnv2.

eqTypes :: [Type] -> [Type] -> Bool Source #

Type equality on lists of types, looking through type synonyms

pickyEqType :: Type -> Type -> Bool Source #

Like pickyEqTypeVis, but returns a Bool for convenience

tcEqTypeNoKindCheck :: Type -> Type -> Bool Source #

Just like tcEqType, but will return True for types of different kinds as long as their non-coercion structure is identical.

tcEqTyConApps :: TyCon -> [Type] -> TyCon -> [Type] -> Bool Source #

Check whether two TyConApps are the same; if the number of arguments are different, just checks the common prefix of arguments.

mayLookIdentical :: Type -> Type -> Bool Source #

Returns True if the visible part of the types might look equal, even if they are really unequal (in the invisible bits)

This function is very similar to tc_eq_type but it is much more heuristic. Notably, it is always safe to return True, even with types that might (in truth) be unequal -- this affects error messages only (Originally this test was done by eqType with an extra flag, but the result was hard to understand.)

Type comparison

Visiblity comparision

eqForAllVis :: ForAllTyFlag -> ForAllTyFlag -> Bool Source #

Do these denote the same level of visibility? Required arguments are visible, others are not. So this function equates Specified and Inferred. Used for printing.

cmpForAllVis :: ForAllTyFlag -> ForAllTyFlag -> Ordering Source #

Do these denote the same level of visibility? Required arguments are visible, others are not. So this function equates Specified and Inferred. Used for printing.