HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-10.0.0.20260917GHC2024

GHC.Core.TyCo.Compare

Type equality and comparison

  • 2 types
  • 16 values

Type equality

11 declarations
valueeqType :: HasCallStack => Type -> Type -> Bool
#

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

valueeqTypes :: [Type] -> [Type] -> Bool
#

Type equality on lists of types, looking through type synonyms

valuetcEqTyConApps :: TyCon -> [Type] -> TyCon -> [Type] -> Bool
#

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 returned invis_bits.

See Note [mayLookIdentical], as well as Note [Showing invisible bits of types in error messages] in GHC.Tc.Errors.Ppr.

datadata InvisibleBit
#

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

Type comparison

1 declaration

Visiblity comparision

2 declarations