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

Modulesome-1.1Haskell2010

Data.EqP

  • 1 class
  • Packagesome-1.1
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceEqP.hs
classclass (forall (a :: k). Eq (f a)) => EqP (f :: k -> Type) where
#

Heterogenous lifted equality.

This class is stronger version of Eq1 from base

class (forall a. Eq a => Eq (f a)) => Eq1 f where
    liftEq :: (a -> b -> Bool) -> f a -> f b -> Bool

as we don't require a a -> b -> Bool function.

Morally Eq1 should be a superclass of EqP, but it cannot be, as GHC wouldn't allow EqP to be polykinded. https://gitlab.haskell.org/ghc/ghc/-/issues/22682

Laws

reflexivity

eqp x x ≡ True

symmetry

eqp x y ≡ eqp y x

transitivity

eqp x y ≡ eqp y z ≡ True ⇒ eqp x z ≡ True

compatibility

eqp x y ≡ x == y

extensionality

eqp x y ≡ True ⇒ f x == f y ≡ True

for polymorphic

f :: forall x. f x -> a

and

Eq a

.

Note: P stands for phantom.

Methods

Instances13EqP, …