HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleghc-9.14.1GHC2021

GHC.Core.TyCo.Compare

Type equality and comparison

  • 15 values
  • Packageghc-9.14.1
  • Exports15
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceCompare.hs

Type equality

12 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.

valuemayLookIdentical :: Type -> Type -> Bool
#

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

1 declaration

Visiblity comparision

2 declarations