trait Order[A <: Data] extends PartialOrder[A]
The Order
type class is used to define a total ordering on some type A
.
An order is defined by a relation <=, which obeys the following laws:
- either x <= y or y <= x (totality) - if x <= y and y <= x, then x == y (antisymmetry) - if x <= y and y <= z, then x <= z (transitivity)
The truth table for compare is defined as follows:
x <= y x >= y Int true true = 0 (corresponds to x == y) true false < 0 (corresponds to x < y) false true > 0 (corresponds to x > y)
By the totality law, x <= y and y <= x cannot be both false.
- Self Type
- Order[A]
- Alphabetic
- By Inheritance
- Order
- PartialOrder
- Eq
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def compare(x: A, y: A): ComparisonBundle
- abstract def getClass(): Class[_ <: AnyRef]
- Definition Classes
- Any
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def equals(arg0: Any): Boolean
- Definition Classes
- Any
- def eqv(x: A, y: A): Bool
Returns
true
ifx
andy
are equivalent,false
otherwise.Returns
true
ifx
andy
are equivalent,false
otherwise.- Definition Classes
- Order → PartialOrder → Eq
- def gt(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
- def gteqv(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
- def hashCode(): Int
- Definition Classes
- Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lt(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
- def lteqv(x: A, y: A): Bool
- Definition Classes
- Order → PartialOrder
- def max(x: A, y: A): A
- def min(x: A, y: A): A
- def neqv(x: A, y: A): Bool
Returns
false
ifx
andy
are equivalent,true
otherwise.Returns
false
ifx
andy
are equivalent,true
otherwise.- Definition Classes
- Eq
- def on[B <: Data](f: (B) => A): Order[B]
Defines an order on
B
by mappingB
toA
usingf
and usingA
s order to orderB
.Defines an order on
B
by mappingB
toA
usingf
and usingA
s order to orderB
.- Definition Classes
- Order → PartialOrder → Eq
- def partialCompare(x: A, y: A): ValidIO[ComparisonBundle]
Result of comparing
x
withy
.Result of comparing
x
withy
. Returns ValidIO[ComparisonBundle] withvalid
false if operands are not comparable. If operands are comparable,bits.lt
will be true ifx
<y
andbits.eq
will be true ifx
=y
- Definition Classes
- Order → PartialOrder
- def pmax(x: A, y: A): ValidIO[A]
Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.
Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.
- Definition Classes
- PartialOrder
- def pmin(x: A, y: A): ValidIO[A]
Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.
Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.
- Definition Classes
- PartialOrder
- def reverse: Order[A]
Defines an ordering on
A
where all arrows switch direction.Defines an ordering on
A
where all arrows switch direction.- Definition Classes
- Order → PartialOrder
- def toString(): String
- Definition Classes
- Any