{-# LANGUAGE Safe #-}
module SDP.Comparing
(
module Data.Ord,
module Data.Eq,
Equal, Compare,
(<=>), eqfst, eqsnd, cmpfst, cmpsnd, invertcmp
)
where
import Data.Function
import Data.Ord
import Data.Eq
default ()
infixl 4 <=>
type Equal e = e -> e -> Bool
type Compare e = e -> e -> Ordering
(<=>) :: (Ord o) => Compare o
<=> :: Compare o
(<=>) = Compare o
forall a. Ord a => a -> a -> Ordering
compare
eqfst :: (Eq e) => Equal (e, s)
eqfst :: Equal (e, s)
eqfst = e -> e -> Bool
forall a. Eq a => a -> a -> Bool
(==) (e -> e -> Bool) -> ((e, s) -> e) -> Equal (e, s)
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` (e, s) -> e
forall a b. (a, b) -> a
fst
eqsnd :: (Eq e) => Equal (f, e)
eqsnd :: Equal (f, e)
eqsnd = e -> e -> Bool
forall a. Eq a => a -> a -> Bool
(==) (e -> e -> Bool) -> ((f, e) -> e) -> Equal (f, e)
forall b c a. (b -> b -> c) -> (a -> b) -> a -> a -> c
`on` (f, e) -> e
forall a b. (a, b) -> b
snd
cmpfst :: (Ord o) => Compare (o, s)
cmpfst :: Compare (o, s)
cmpfst = ((o, s) -> o) -> Compare (o, s)
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing (o, s) -> o
forall a b. (a, b) -> a
fst
cmpsnd :: (Ord o) => Compare (f, o)
cmpsnd :: Compare (f, o)
cmpsnd = ((f, o) -> o) -> Compare (f, o)
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing (f, o) -> o
forall a b. (a, b) -> b
snd
invertcmp :: Compare e -> Compare e
invertcmp :: Compare e -> Compare e
invertcmp = Compare e -> Compare e
forall a b c. (a -> b -> c) -> b -> a -> c
flip