Type equality comparing both visible and invisible arguments, expanding synonyms and respecting multiplicities.
Moduleghc-10.0.0.20260917GHC2024
GHC.Core.TyCo.Compare
Type equality and comparison
- 2 types
- 16 values
- Packageghc-10.0.0.20260917
- Exports18
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceCompare.hs
Type equality
11 declarationsCompare types with respect to a (presumably) non-empty RnEnv2.
Type equality on lists of types, looking through type synonyms
Like pickyEqTypeVis, but returns a Bool for convenience
Just like tcEqType, but will return True for types of different kinds as long as their non-coercion structure is identical.
Check whether two TyConApps are the same; if the number of arguments are different, just checks the common prefix of arguments.
Dealing with invisible bits in types
mayLookIdentical returns:
An empty set if the two types are distinct unequal, and remain distinct even if we hide explicit kinds, runtime-reps, multiplicities.
A non-empty set of
invis_bits, if the two types might look equal, but are in fact distinct in the returnedinvis_bits.
See Note [mayLookIdentical], as well as Note [Showing invisible bits of types in error messages] in GHC.Tc.Errors.Ppr.
Make the sure the given invisible bits are displayed.
See Note [Showing invisible bits of types in error messages] in GHC.Tc.Errors.Ppr.
Something in a type which might be invisible.
Used to avoid reporting confusing errors to the user, like:
Couldn't match (a -> b) with (a -> b)When in fact it is e.g. (a %1 -> b) vs (a %Many -> b), but the multiplicites have been suppressed.
See Note [Showing invisible bits of types in error messages] in GHC.Tc.Errors.Ppr.
Instances4Eq, Ord, Show, Outputable
Eq InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareOrd InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareShow InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareOutputable InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.Compare
A collection of InvisibleBits.