**Packages**- is:exact
- is:module
- base
- ghc-prim
- Cabal
- hedgehog
- rio
- classy-prelude
- numeric-prelude
- relude
- universum
- foundation
- basement
- clash-prelude
- dimensional
- ghc-lib-parser
- rebase
- nri-prelude
- xmonad-contrib
- numhask
- stack
- LambdaHack
- ghc
- protolude
- base-prelude
- prelude-compat
- llvm-hs-pure
- rerebase
- text-show
- genvalidity-hspec
- checkers
- basic-prelude
- first-class-families
- tfp
- leancheck
- alg
- genvalidity-sydtest
- invertible
- texmath
- linear-base
- mixed-types-num
- purescript-bridge

The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype
whose constituent types are in Ord. The declared order of the
constructors in the data declaration determines the ordering in
derived Ord instances. The Ordering datatype allows a
single comparison to determine the precise ordering of two objects.
Ord, as defined by the Haskell report, implements a total order
and has the following properties:
*not* require min and
max to return either of their arguments. The result is merely
required to *equal* one of the arguments in terms of (==).
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.

**Comparability**`x <= y || y <= x`= Trueif**Transitivity**`x <= y && y <= z`= True, then`x <= z`= True**Reflexivity**`x <= x`= Trueif**Antisymmetry**`x <= y && y <= x`= True, then`x == y`= True

`x >= y`=`y <= x``x < y`=`x <= y && x /= y``x > y`=`y < x``x < y`=`compare x y == LT``x > y`=`compare x y == GT``x == y`=`compare x y == EQ``min x y == if x <= y then x else y`= True`max x y == if x >= y then x else y`= True

The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype
whose constituent types are in Ord. The declared order of the
constructors in the data declaration determines the ordering in
derived Ord instances. The Ordering datatype allows a
single comparison to determine the precise ordering of two objects.
Ord, as defined by the Haskell report, implements a total order
and has the following properties:
*not* require min and
max to return either of their arguments. The result is merely
required to *equal* one of the arguments in terms of (==).
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.

**Comparability**`x <= y || y <= x`= Trueif**Transitivity**`x <= y && y <= z`= True, then`x <= z`= True**Reflexivity**`x <= x`= Trueif**Antisymmetry**`x <= y && y <= x`= True, then`x == y`= True

`x >= y`=`y <= x``x < y`=`x <= y && x /= y``x > y`=`y < x``x < y`=`compare x y == LT``x > y`=`compare x y == GT``x == y`=`compare x y == EQ``min x y == if x <= y then x else y`= True`max x y == if x >= y then x else y`= True

Cabal Distribution.Compat.Prelude.Internal, hedgehog Hedgehog.Internal.Prelude, rio RIO.Prelude.Types, classy-prelude ClassyPrelude, numeric-prelude NumericPrelude NumericPrelude.Base, relude Relude.Base, universum Universum.Base, foundation Foundation, basement Basement.Compat.Base Basement.Imports, clash-prelude Clash.HaskellPrelude, dimensional Numeric.Units.Dimensional.Prelude, ghc-lib-parser GHC.Prelude, rebase Rebase.Prelude, nri-prelude Basics, xmonad-contrib XMonad.Config.Prime, numhask NumHask.Prelude, stack Stack.Prelude, LambdaHack Game.LambdaHack.Core.Prelude

The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype
whose constituent types are in Ord. The declared order of the
constructors in the data declaration determines the ordering in
derived Ord instances. The Ordering datatype allows a
single comparison to determine the precise ordering of two objects.
The Haskell Report defines no laws for Ord. However,
<= is customarily expected to implement a non-strict partial
order and have the following properties:
*not* require min and
max to return either of their arguments. The result is merely
required to *equal* one of the arguments in terms of (==).
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.

if**Transitivity**`x <= y && y <= z`= True, then`x <= z`= True**Reflexivity**`x <= x`= Trueif**Antisymmetry**`x <= y && y <= x`= True, then`x == y`= True

`x >= y`=`y <= x``x < y`=`x <= y && x /= y``x > y`=`y < x``x < y`=`compare x y == LT``x > y`=`compare x y == GT``x == y`=`compare x y == EQ``min x y == if x <= y then x else y`= True`max x y == if x >= y then x else y`= True

protolude Protolude, base-prelude BasePrelude, prelude-compat Prelude2010, llvm-hs-pure LLVM.Prelude

The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype
whose constituent types are in Ord. The declared order of the
constructors in the data declaration determines the ordering in
derived Ord instances. The Ordering datatype allows a
single comparison to determine the precise ordering of two objects.
The Haskell Report defines no laws for Ord. However,
<= is customarily expected to implement a non-strict partial
order and have the following properties:

if**Transitivity**`x <= y && y <= z`= True, then`x <= z`= True**Reflexivity**`x <= x`= Trueif**Antisymmetry**`x <= y && y <= x`= True, then`x == y`= True

`x >= y`=`y <= x``x < y`=`x <= y && x /= y``x > y`=`y < x``x < y`=`compare x y == LT``x > y`=`compare x y == GT``x == y`=`compare x y == EQ``min x y == if x <= y then x else y`= True`max x y == if x >= y then x else y`= True

Ord properties
You will need `TypeApplications` to use these.

The Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype
whose constituent types are in Ord. The declared order of the
constructors in the data declaration determines the ordering in
derived Ord instances. The Ordering datatype allows a
single comparison to determine the precise ordering of two objects.
Minimal complete definition: either compare or <=.
Using compare can be more efficient for complex types.

Equality and ordering.
Note that equality doesn't really require a class, it can be defined
uniformly as TyEq.

This *optional* module is part of LeanCheck, a simple enumerative
property-based testing library.
Toy Eq and Ord instance for functions.
`12` value. Keep in mind that this value is
number of tests for *each* argument.
**Warning:** this is only intended to be used in testing modules.
Avoid importing this on modules that are used as libraries as there is
no way to unimport a typeclass instance.

instance (Listable a, Eq b) => Eq (a -> b) where (==) = areEqualFor 12

instance (Listable a, Ord b) => Ord (a -> b) where compare = compareFor 12This compares functions by testing them for up to 12 different values of each argument. Single argument functions are tested 12 times. Two argument functions are tested 144 times. Three argument functions are tested 1728 times. At each subsequent argument, number of tests and runtime increases 12-fold. To customize the number of tests, don't import this and use the above code changing the

Ord properties
You will need `TypeApplications` to use these.

Linear Orderings
Linear orderings provide a strict order. The laws for `(<=)`
for all <math>:
`<`:
`compare` doesn't
follow from `<=` since it requires calls: one to
`<=` and one to `==`. However, from a linear
`compare` it is easy to implement the others. Hence, the
minimal complete definition only contains `compare`.

- reflexivity: <math>
- antisymmetry: <math>
- transitivity: <math>

`x <= y`=`not (y > x)``x >= y`=`not (y < x)`