type Equality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = forall k3 (p :: k1 -> k3 -> Type) (f :: k2 -> k3). p a (f b) -> p s (f t)A witness that (a ~ s, b ~ t).
Note: Composition with an Equality is index-preserving.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelens-5.3.5Haskell2010
type Equality (s :: k1) (t :: k2) (a :: k1) (b :: k2) = forall k3 (p :: k1 -> k3 -> Type) (f :: k2 -> k3). p a (f b) -> p s (f t)A witness that (a ~ s, b ~ t).
Note: Composition with an Equality is index-preserving.
type AnEquality (s :: k) (t :: k1) (a :: k) (b :: k2) = Identical a (Proxy b) a (Proxy b) -> Identical a (Proxy b) s (Proxy t)When you see this as an argument to a function, it expects an Equality.
A Simple AnEquality.
Propositional equality. If a :~: b is inhabited by some terminating
value, then the type a is the same as the type b. To use this equality
in practice, pattern-match on the a :~: b to get out the Refl constructor;
in the body of the pattern-match, the compiler knows that a ~ b.
Category (:~:)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.CategoryGroupoid (:~:)Defined in semigroupoids-6.0.1 · Data.GroupoidSemigroupoid (:~:)Defined in semigroupoids-6.0.1 · Data.SemigroupoidTestCoercion ((:~:) a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.CoercionTestEquality ((:~:) a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityNFData2 (:~:)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData1 ((:~:) a)Defined in deepseq-1.5.0.0 · Control.DeepSeqa ~ b => Bounded (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equalitya ~ b => Enum (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityEq (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality(a ~ b, Data a) => Data (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equalitya ~ b => Read (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityShow (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityNFData (a :~: b)Defined in deepseq-1.5.0.0 · Control.DeepSeqExtract a witness of type Equality.
Substituting types with Equality.
We can use Equality to do substitution into anything.
Equality is symmetric.
This is an adverb that can be used to modify many other Lens combinators to make them require simple lenses, simple traversals, simple prisms or simple isos as input.
Construct an Equality from explicit equality evidence.
A version of substEq that provides explicit, rather than implicit, equality evidence.
The opposite of working overEquality is working underEquality.
Recover a "profunctor lens" form of equality. Reverses fromLeibniz.
Convert a "profunctor lens" form of equality to an equality. Reverses overEquality.
The type should be understood as
fromLeibniz :: (forall p. p a b -> p s t) -> Equality s t a b