Data.EqP

some-1.0.6: Existential type: Some

Safe Haskell | Safe
Language | Haskell2010

Data.EqP

Synopsis

- class (forall (a :: k). Eq (f a)) => EqP (f :: k -> Type) where
  - eqp :: forall (a :: k) (b :: k). f a -> f b -> Bool

# Documentation

class (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.

Since: 1.0.5

Methods

eqp :: forall (a :: k) (b :: k). f a -> f b -> Bool #

#### Instances

Instances details

EqP SNat # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: Nat) (b :: Nat). SNat a -> SNat b -> Bool #
EqP SChar # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: Char) (b :: Char). SChar a -> SChar b -> Bool #
EqP SSymbol # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: Symbol) (b :: Symbol). SSymbol a -> SSymbol b -> Bool #
EqP StableName # |
Instance details Defined in Data.EqP Methods eqp :: StableName a -> StableName b -> Bool #
EqP (Proxy :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: k) (b :: k). Proxy a -> Proxy b -> Bool #
EqP (TypeRep :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: k) (b :: k). TypeRep a -> TypeRep b -> Bool #
Eq a => EqP (Const a :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b :: k). Const a a0 -> Const a b -> Bool #
EqP ((:~:) a :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b :: k). (a :~: a0) -> (a :~: b) -> Bool #
(EqP a, EqP b) => EqP (Product a b :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b0 :: k). Product a b a0 -> Product a b b0 -> Bool #
(EqP a, EqP b) => EqP (Sum a b :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b0 :: k). Sum a b a0 -> Sum a b b0 -> Bool #
EqP ((:~~:) a :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b :: k). (a :~~: a0) -> (a :~~: b) -> Bool #
(EqP a, EqP b) => EqP (a :*: b :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a0 :: k) (b0 :: k). (a :*: b) a0 -> (a :*: b) b0 -> Bool #
(EqP f, EqP g) => EqP (f :+: g :: k -> Type) # |
Instance details Defined in Data.EqP Methods eqp :: forall (a :: k) (b :: k). (f :+: g) a -> (f :+: g) b -> Bool #