{-# LANGUAGE DefaultSignatures #-}
module OAlg.Data.Equal
(
Eq(..), eql, ngt
, Eq1(..)
, Eq2(..)
)
where
import Data.Proxy
eql :: (a -> a -> Ordering) -> a -> a -> Bool
eql :: forall a. (a -> a -> Ordering) -> a -> a -> Bool
eql a -> a -> Ordering
cmp a
a a
b = (a
a a -> a -> Ordering
`cmp` a
b) forall a. Eq a => a -> a -> Bool
== Ordering
EQ
ngt :: (a -> a -> Ordering) -> a -> a -> Bool
ngt :: forall a. (a -> a -> Ordering) -> a -> a -> Bool
ngt a -> a -> Ordering
cmp a
a a
b = (a
a a -> a -> Ordering
`cmp` a
b) forall a. Eq a => a -> a -> Bool
/= Ordering
GT
class Eq1 p where
eq1 :: p x -> p x -> Bool
default eq1 :: Eq (p x) => p x -> p x -> Bool
eq1 = forall a. Eq a => a -> a -> Bool
(==)
instance Eq1 Proxy
class Eq2 h where
eq2 :: h x y -> h x y -> Bool
default eq2 :: Eq (h x y) => h x y -> h x y -> Bool
eq2 = forall a. Eq a => a -> a -> Bool
(==)