module Test.LeanCheck.Utils.Operators
(
(==>)
, (===), (====)
, (&&&), (&&&&), (&&&&&)
, (|||), (||||)
, isIdempotent
, isIdentity
, isNeverIdentity
, isCommutative
, isAssociative
, isDistributiveOver
, isLeftDistributiveOver
, isRightDistributiveOver
, isFlipped
, isTransitive
, isReflexive
, isIrreflexive
, isSymmetric
, isAsymmetric
, isAntisymmetric
, isEquivalence
, isPartialOrder
, isStrictPartialOrder
, isTotalOrder
, isStrictTotalOrder
, isComparison
, (=$), ($=)
, (=|), (|=)
, okEq
, okOrd
, okEqOrd
, okNum
, okNumNonNegative
, idempotent
, identity
, neverIdentity
, commutative
, associative
, distributive
, symmetric2
, transitive
, reflexive
, irreflexive
, symmetric
, asymmetric
, antisymmetric
, equivalence
, partialOrder
, strictPartialOrder
, totalOrder
, strictTotalOrder
, comparison
)
where
import Test.LeanCheck ((==>))
combine :: (b -> c -> d) -> (a -> b) -> (a -> c) -> (a -> d)
combine :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine b -> c -> d
(?) a -> b
f a -> c
g = \a
x -> a -> b
f a
x b -> c -> d
? a -> c
g a
x
(===) :: Eq b => (a -> b) -> (a -> b) -> a -> Bool
=== :: (a -> b) -> (a -> b) -> a -> Bool
(===) = (b -> b -> Bool) -> (a -> b) -> (a -> b) -> a -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine b -> b -> Bool
forall a. Eq a => a -> a -> Bool
(==)
infix 4 ===
(====) :: Eq c => (a -> b -> c) -> (a -> b -> c) -> a -> b -> Bool
==== :: (a -> b -> c) -> (a -> b -> c) -> a -> b -> Bool
(====) = ((b -> c) -> (b -> c) -> b -> Bool)
-> (a -> b -> c) -> (a -> b -> c) -> a -> b -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine (b -> c) -> (b -> c) -> b -> Bool
forall b a. Eq b => (a -> b) -> (a -> b) -> a -> Bool
(===)
infix 4 ====
(&&&) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
&&& :: (a -> Bool) -> (a -> Bool) -> a -> Bool
(&&&) = (Bool -> Bool -> Bool) -> (a -> Bool) -> (a -> Bool) -> a -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine Bool -> Bool -> Bool
(&&)
infixr 3 &&&
(&&&&) :: (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
&&&& :: (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
(&&&&) = ((b -> Bool) -> (b -> Bool) -> b -> Bool)
-> (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine (b -> Bool) -> (b -> Bool) -> b -> Bool
forall a. (a -> Bool) -> (a -> Bool) -> a -> Bool
(&&&)
infixr 3 &&&&
(&&&&&) :: (a -> b -> c -> Bool) -> (a -> b -> c -> Bool) -> a -> b -> c -> Bool
&&&&& :: (a -> b -> c -> Bool)
-> (a -> b -> c -> Bool) -> a -> b -> c -> Bool
(&&&&&) = ((b -> c -> Bool) -> (b -> c -> Bool) -> b -> c -> Bool)
-> (a -> b -> c -> Bool)
-> (a -> b -> c -> Bool)
-> a
-> b
-> c
-> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine (b -> c -> Bool) -> (b -> c -> Bool) -> b -> c -> Bool
forall a b. (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
(&&&&)
infixr 3 &&&&&
(|||) :: (a -> Bool) -> (a -> Bool) -> a -> Bool
||| :: (a -> Bool) -> (a -> Bool) -> a -> Bool
(|||) = (Bool -> Bool -> Bool) -> (a -> Bool) -> (a -> Bool) -> a -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine Bool -> Bool -> Bool
(||)
infixr 2 |||
(||||) :: (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
|||| :: (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
(||||) = ((b -> Bool) -> (b -> Bool) -> b -> Bool)
-> (a -> b -> Bool) -> (a -> b -> Bool) -> a -> b -> Bool
forall b c d a. (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
combine (b -> Bool) -> (b -> Bool) -> b -> Bool
forall a. (a -> Bool) -> (a -> Bool) -> a -> Bool
(|||)
infixr 2 ||||
isCommutative :: Eq b => (a -> a -> b) -> a -> a -> Bool
isCommutative :: (a -> a -> b) -> a -> a -> Bool
isCommutative a -> a -> b
(?) = \a
x a
y -> a
x a -> a -> b
? a
y b -> b -> Bool
forall a. Eq a => a -> a -> Bool
== a
y a -> a -> b
? a
x
isAssociative :: Eq a => (a -> a -> a) -> a -> a -> a -> Bool
isAssociative :: (a -> a -> a) -> a -> a -> a -> Bool
isAssociative a -> a -> a
(?) = \a
x a
y a
z -> a
x a -> a -> a
? (a
y a -> a -> a
? a
z) a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== (a
x a -> a -> a
? a
y) a -> a -> a
? a
z
isDistributiveOver :: Eq a
=> (a -> a -> a) -> (a -> a -> a)
-> a -> a -> a -> Bool
isDistributiveOver :: (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
isDistributiveOver = (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
forall a.
Eq a =>
(a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
isLeftDistributiveOver
isLeftDistributiveOver :: Eq a
=> (a -> a -> a) -> (a -> a -> a)
-> a -> a -> a -> Bool
a -> a -> a
(?) isLeftDistributiveOver :: (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
`isLeftDistributiveOver` a -> a -> a
(#) = \a
x a
y a
z -> a
x a -> a -> a
? (a
y a -> a -> a
# a
z) a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== (a
x a -> a -> a
? a
y) a -> a -> a
# (a
x a -> a -> a
? a
z)
isRightDistributiveOver :: Eq a
=> (a -> a -> a) -> (a -> a -> a)
-> a -> a -> a -> Bool
a -> a -> a
(?) isRightDistributiveOver :: (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
`isRightDistributiveOver` a -> a -> a
(#) = \a
x a
y a
z -> (a
y a -> a -> a
# a
z) a -> a -> a
? a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== (a
y a -> a -> a
? a
x) a -> a -> a
# (a
z a -> a -> a
? a
x)
isFlipped :: Eq c => (a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
a -> b -> c
(+-) isFlipped :: (a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
`isFlipped` b -> a -> c
(-+) = \a
x b
y -> a
x a -> b -> c
+- b
y c -> c -> Bool
forall a. Eq a => a -> a -> Bool
== b
y b -> a -> c
-+ a
x
isTransitive :: (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive :: (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(?) = \a
x a
y a
z -> a
x a -> a -> Bool
? a
y Bool -> Bool -> Bool
&& a
y a -> a -> Bool
? a
z Bool -> Bool -> Bool
==> a
x a -> a -> Bool
? a
z
isReflexive :: (a -> a -> Bool) -> a -> Bool
isReflexive :: (a -> a -> Bool) -> a -> Bool
isReflexive a -> a -> Bool
(?) = \a
x -> a
x a -> a -> Bool
? a
x
isIrreflexive :: (a -> a -> Bool) -> a -> Bool
isIrreflexive :: (a -> a -> Bool) -> a -> Bool
isIrreflexive a -> a -> Bool
(?) = \a
x -> Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ a
x a -> a -> Bool
? a
x
isSymmetric :: (a -> a -> Bool) -> a -> a -> Bool
isSymmetric :: (a -> a -> Bool) -> a -> a -> Bool
isSymmetric = (a -> a -> Bool) -> a -> a -> Bool
forall b a. Eq b => (a -> a -> b) -> a -> a -> Bool
isCommutative
isAntisymmetric :: Eq a => (a -> a -> Bool) -> a -> a -> Bool
isAntisymmetric :: (a -> a -> Bool) -> a -> a -> Bool
isAntisymmetric a -> a -> Bool
(?) = \a
x a
y -> a
x a -> a -> Bool
? a
y Bool -> Bool -> Bool
&& a
y a -> a -> Bool
? a
x Bool -> Bool -> Bool
==> a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
y
isAsymmetric :: (a -> a -> Bool) -> a -> a -> Bool
isAsymmetric :: (a -> a -> Bool) -> a -> a -> Bool
isAsymmetric a -> a -> Bool
(?) = \a
x a
y -> a
x a -> a -> Bool
? a
y Bool -> Bool -> Bool
==> Bool -> Bool
not (a
y a -> a -> Bool
? a
x)
isEquivalence :: (a -> a -> Bool) -> a -> a -> a -> Bool
isEquivalence :: (a -> a -> Bool) -> a -> a -> a -> Bool
isEquivalence a -> a -> Bool
(==) = \a
x a
y a
z -> (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isReflexive a -> a -> Bool
(==) a
x
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> Bool
isSymmetric a -> a -> Bool
(==) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(==) a
x a
y a
z
isPartialOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isPartialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
isPartialOrder a -> a -> Bool
(<=) = \a
x a
y a
z -> (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isReflexive a -> a -> Bool
(<=) a
x
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> Bool
isAntisymmetric a -> a -> Bool
(<=) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(<=) a
x a
y a
z
isStrictPartialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictPartialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictPartialOrder a -> a -> Bool
(<) = \a
x a
y a
z -> (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isIrreflexive a -> a -> Bool
(<) a
x
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> Bool
isAsymmetric a -> a -> Bool
(<) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(<) a
x a
y a
z
isTotalOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isTotalOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
isTotalOrder a -> a -> Bool
(<=) = \a
x a
y a
z -> (a
x a -> a -> Bool
<= a
y Bool -> Bool -> Bool
|| a
y a -> a -> Bool
<= a
x)
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> Bool
isAntisymmetric a -> a -> Bool
(<=) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(<=) a
x a
y a
z
isStrictTotalOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictTotalOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictTotalOrder a -> a -> Bool
(<) = \a
x a
y a
z -> (a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
/= a
y Bool -> Bool -> Bool
==> a
x a -> a -> Bool
< a
y Bool -> Bool -> Bool
|| a
y a -> a -> Bool
< a
x)
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isIrreflexive a -> a -> Bool
(<) a
x
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> Bool
isAsymmetric a -> a -> Bool
(<) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(<) a
x a
y a
z
isComparison :: (a -> a -> Ordering) -> a -> a -> a -> Bool
isComparison :: (a -> a -> Ordering) -> a -> a -> a -> Bool
isComparison a -> a -> Ordering
compare = \a
x a
y a
z -> (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isEquivalence a -> a -> Bool
(===) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isIrreflexive a -> a -> Bool
(<) a
x
Bool -> Bool -> Bool
&& (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive a -> a -> Bool
(<) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a -> Bool
(<) (a -> a -> Bool) -> (a -> a -> Bool) -> a -> a -> Bool
forall c a b.
Eq c =>
(a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
`isFlipped` a -> a -> Bool
(>)) a
x a
y
where
a
x === :: a -> a -> Bool
=== a
y = a
x a -> a -> Ordering
`compare` a
y Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
EQ
a
x < :: a -> a -> Bool
< a
y = a
x a -> a -> Ordering
`compare` a
y Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
LT
a
x > :: a -> a -> Bool
> a
y = a
x a -> a -> Ordering
`compare` a
y Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
GT
isIdempotent :: Eq a => (a -> a) -> a -> Bool
isIdempotent :: (a -> a) -> a -> Bool
isIdempotent a -> a
f = a -> a
f (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
f (a -> a) -> (a -> a) -> a -> Bool
forall b a. Eq b => (a -> b) -> (a -> b) -> a -> Bool
=== a -> a
f
isIdentity :: Eq a => (a -> a) -> a -> Bool
isIdentity :: (a -> a) -> a -> Bool
isIdentity a -> a
f = a -> a
f (a -> a) -> (a -> a) -> a -> Bool
forall b a. Eq b => (a -> b) -> (a -> b) -> a -> Bool
=== a -> a
forall a. a -> a
id
isNeverIdentity :: Eq a => (a -> a) -> a -> Bool
isNeverIdentity :: (a -> a) -> a -> Bool
isNeverIdentity = (Bool -> Bool
not (Bool -> Bool) -> (a -> Bool) -> a -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((a -> Bool) -> a -> Bool)
-> ((a -> a) -> a -> Bool) -> (a -> a) -> a -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdentity
okEq :: Eq a => a -> a -> a -> Bool
okEq :: a -> a -> a -> Bool
okEq a
x a
y a
z = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isEquivalence a -> a -> Bool
forall a. Eq a => a -> a -> Bool
(==) a
x a
y a
z
Bool -> Bool -> Bool
&& (a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
/= a
y) Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
== Bool -> Bool
not (a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
y)
okOrd :: Ord a => a -> a -> a -> Bool
okOrd :: a -> a -> a -> Bool
okOrd a
x a
y a
z = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isTotalOrder a -> a -> Bool
forall a. Ord a => a -> a -> Bool
(<=) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a -> Ordering) -> a -> a -> a -> Bool
forall a. (a -> a -> Ordering) -> a -> a -> a -> Bool
isComparison a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
compare a
x a
y a
z
Bool -> Bool -> Bool
&& (a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
<= a
y) Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
== ((a
x a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` a
y) Ordering -> [Ordering] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Ordering
LT,Ordering
EQ])
okEqOrd :: (Eq a, Ord a) => a -> a -> a -> Bool
okEqOrd :: a -> a -> a -> Bool
okEqOrd a
x a
y a
z = a -> a -> a -> Bool
forall a. Eq a => a -> a -> a -> Bool
okEq a
x a
y a
z
Bool -> Bool -> Bool
&& a -> a -> a -> Bool
forall a. Ord a => a -> a -> a -> Bool
okOrd a
x a
y a
z
Bool -> Bool -> Bool
&& (a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
y) Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
== (a
x a -> a -> Ordering
forall a. Ord a => a -> a -> Ordering
`compare` a
y Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Ordering
EQ)
okNumNonNegative :: (Eq a, Num a) => a -> a -> a -> Bool
okNumNonNegative :: a -> a -> a -> Bool
okNumNonNegative a
x a
y a
z = (a -> a -> a) -> a -> a -> Bool
forall b a. Eq b => (a -> a -> b) -> a -> a -> Bool
isCommutative a -> a -> a
forall a. Num a => a -> a -> a
(+) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> a) -> a -> a -> Bool
forall b a. Eq b => (a -> a -> b) -> a -> a -> Bool
isCommutative a -> a -> a
forall a. Num a => a -> a -> a
(*) a
x a
y
Bool -> Bool -> Bool
&& (a -> a -> a) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> a) -> a -> a -> a -> Bool
isAssociative a -> a -> a
forall a. Num a => a -> a -> a
(+) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a -> a) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> a) -> a -> a -> a -> Bool
isAssociative a -> a -> a
forall a. Num a => a -> a -> a
(*) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a -> a
forall a. Num a => a -> a -> a
(*) (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
forall a.
Eq a =>
(a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
`isDistributiveOver` a -> a -> a
forall a. Num a => a -> a -> a
(+)) a
x a
y a
z
Bool -> Bool -> Bool
&& (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdempotent (a -> a -> a
forall a. Num a => a -> a -> a
+a
0) a
x
Bool -> Bool -> Bool
&& (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdempotent (a -> a -> a
forall a. Num a => a -> a -> a
*a
1) a
x
Bool -> Bool -> Bool
&& (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdempotent a -> a
forall a. Num a => a -> a
abs a
x
Bool -> Bool -> Bool
&& (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdempotent a -> a
forall a. Num a => a -> a
signum a
x
Bool -> Bool -> Bool
&& a -> a
forall a. Num a => a -> a
abs a
x a -> a -> a
forall a. Num a => a -> a -> a
* a -> a
forall a. Num a => a -> a
signum a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
x
okNum :: (Eq a, Num a) => a -> a -> a -> Bool
okNum :: a -> a -> a -> Bool
okNum a
x a
y a
z = a -> a -> a -> Bool
forall a. (Eq a, Num a) => a -> a -> a -> Bool
okNumNonNegative a
x a
y a
z
Bool -> Bool -> Bool
&& a -> a
forall a. Num a => a -> a
negate (a -> a
forall a. Num a => a -> a
negate a
x) a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
x
Bool -> Bool -> Bool
&& a
x a -> a -> a
forall a. Num a => a -> a -> a
- a
x a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
0
(=$) :: Eq b => a -> (a -> b) -> a -> Bool
(a
x =$ :: a -> (a -> b) -> a -> Bool
=$ a -> b
f) a
y = a -> b
f a
x b -> b -> Bool
forall a. Eq a => a -> a -> Bool
== a -> b
f a
y
infixl 4 =$
($=) :: (a -> Bool) -> a -> Bool
$= :: (a -> Bool) -> a -> Bool
($=) = (a -> Bool) -> a -> Bool
forall a b. (a -> b) -> a -> b
($)
infixl 4 $=
(=|) :: Eq a => [a] -> Int -> [a] -> Bool
[a]
xs =| :: [a] -> Int -> [a] -> Bool
=| Int
n = [a]
xs [a] -> ([a] -> [a]) -> [a] -> Bool
forall b a. Eq b => a -> (a -> b) -> a -> Bool
=$ Int -> [a] -> [a]
forall a. Int -> [a] -> [a]
take Int
n
infixl 4 =|
(|=) :: (a -> Bool) -> a -> Bool
|= :: (a -> Bool) -> a -> Bool
(|=) = (a -> Bool) -> a -> Bool
forall a b. (a -> b) -> a -> b
($)
infixl 4 |=
{-# DEPRECATED commutative "Use isCommutative." #-}
commutative :: Eq b => (a -> a -> b) -> a -> a -> Bool
commutative :: (a -> a -> b) -> a -> a -> Bool
commutative = (a -> a -> b) -> a -> a -> Bool
forall b a. Eq b => (a -> a -> b) -> a -> a -> Bool
isCommutative
{-# DEPRECATED associative "Use isAssociative." #-}
associative :: Eq a => (a -> a -> a) -> a -> a -> a -> Bool
associative :: (a -> a -> a) -> a -> a -> a -> Bool
associative = (a -> a -> a) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> a) -> a -> a -> a -> Bool
isAssociative
{-# DEPRECATED distributive "Use isDistributiveOver." #-}
distributive :: Eq a => (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
distributive :: (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
distributive = (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
forall a.
Eq a =>
(a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
isDistributiveOver
{-# DEPRECATED symmetric2 "Use isFlipped." #-}
symmetric2 :: Eq c => (a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
symmetric2 :: (a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
symmetric2 = (a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
forall c a b.
Eq c =>
(a -> b -> c) -> (b -> a -> c) -> a -> b -> Bool
isFlipped
{-# DEPRECATED transitive "Use isTransitive." #-}
transitive :: (a -> a -> Bool) -> a -> a -> a -> Bool
transitive :: (a -> a -> Bool) -> a -> a -> a -> Bool
transitive = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isTransitive
{-# DEPRECATED reflexive "Use isReflexive." #-}
reflexive :: (a -> a -> Bool) -> a -> Bool
reflexive :: (a -> a -> Bool) -> a -> Bool
reflexive = (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isReflexive
{-# DEPRECATED irreflexive "Use isIrreflexive." #-}
irreflexive :: (a -> a -> Bool) -> a -> Bool
irreflexive :: (a -> a -> Bool) -> a -> Bool
irreflexive = (a -> a -> Bool) -> a -> Bool
forall a. (a -> a -> Bool) -> a -> Bool
isIrreflexive
{-# DEPRECATED symmetric "Use isSymmetric." #-}
symmetric :: (a -> a -> Bool) -> a -> a -> Bool
symmetric :: (a -> a -> Bool) -> a -> a -> Bool
symmetric = (a -> a -> Bool) -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> Bool
isSymmetric
{-# DEPRECATED antisymmetric "Use isAntisymmetric." #-}
antisymmetric :: Eq a => (a -> a -> Bool) -> a -> a -> Bool
antisymmetric :: (a -> a -> Bool) -> a -> a -> Bool
antisymmetric = (a -> a -> Bool) -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> Bool
isAntisymmetric
{-# DEPRECATED asymmetric "Use isAsymmetric." #-}
asymmetric :: (a -> a -> Bool) -> a -> a -> Bool
asymmetric :: (a -> a -> Bool) -> a -> a -> Bool
asymmetric = (a -> a -> Bool) -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> Bool
isAsymmetric
{-# DEPRECATED equivalence "Use isEquivalence." #-}
equivalence :: (a -> a -> Bool) -> a -> a -> a -> Bool
equivalence :: (a -> a -> Bool) -> a -> a -> a -> Bool
equivalence = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isEquivalence
{-# DEPRECATED partialOrder "Use isPartialOrder." #-}
partialOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
partialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
partialOrder = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isPartialOrder
{-# DEPRECATED strictPartialOrder "Use isStrictPartialOrder." #-}
strictPartialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
strictPartialOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
strictPartialOrder = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictPartialOrder
{-# DEPRECATED totalOrder "Use isTotalOrder." #-}
totalOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
totalOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
totalOrder = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isTotalOrder
{-# DEPRECATED strictTotalOrder "Use isStrictTotalOrder." #-}
strictTotalOrder :: Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
strictTotalOrder :: (a -> a -> Bool) -> a -> a -> a -> Bool
strictTotalOrder = (a -> a -> Bool) -> a -> a -> a -> Bool
forall a. Eq a => (a -> a -> Bool) -> a -> a -> a -> Bool
isStrictTotalOrder
{-# DEPRECATED comparison "Use isComparison." #-}
comparison :: (a -> a -> Ordering) -> a -> a -> a -> Bool
comparison :: (a -> a -> Ordering) -> a -> a -> a -> Bool
comparison = (a -> a -> Ordering) -> a -> a -> a -> Bool
forall a. (a -> a -> Ordering) -> a -> a -> a -> Bool
isComparison
{-# DEPRECATED idempotent "Use isIdempotent." #-}
idempotent :: Eq a => (a -> a) -> a -> Bool
idempotent :: (a -> a) -> a -> Bool
idempotent = (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdempotent
{-# DEPRECATED identity "Use isIdentity." #-}
identity :: Eq a => (a -> a) -> a -> Bool
identity :: (a -> a) -> a -> Bool
identity = (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isIdentity
{-# DEPRECATED neverIdentity "Use isNeverIdentity." #-}
neverIdentity :: Eq a => (a -> a) -> a -> Bool
neverIdentity :: (a -> a) -> a -> Bool
neverIdentity = (a -> a) -> a -> Bool
forall a. Eq a => (a -> a) -> a -> Bool
isNeverIdentity