Order

object Order extends OrderFunctions[[A] =>> Order[A]] with OrderToOrderingConversion
Companion
class
class OrderFunctions[[A] =>> Order[A]]
class PartialOrderFunctions[[A] =>> Order[A]]
class EqFunctions[[A] =>> Order[A]]
class Object
trait Matchable
class Any

Value members

Concrete methods

def allEqual[A]: Order[A]

An Order instance that considers all A instances to be equal.

An Order instance that considers all A instances to be equal.

@inline
final def apply[A](ev: Order[A]): Order[A]

Access an implicit Order[A].

Access an implicit Order[A].

def by[@specialized A, @specialized B](f: A => B)(ev: Order[B]): Order[A]

Convert an implicit Order[B] to an Order[A] using the given function f.

Convert an implicit Order[B] to an Order[A] using the given function f.

def from[@specialized A](f: (A, A) => Int): Order[A]

Define an Order[A] using the given function f.

Define an Order[A] using the given function f.

def fromLessThan[@specialized A](f: (A, A) => Boolean): Order[A]

Define an Order[A] using the given 'less than' function f.

Define an Order[A] using the given 'less than' function f.

def fromOrdering[A](ev: Ordering[A]): Order[A]
def reverse[@specialized A](order: Order[A]): Order[A]

Defines an ordering on A from the given order such that all arrows switch direction.

Defines an ordering on A from the given order such that all arrows switch direction.

def whenEqual[@specialized A](first: Order[A], second: Order[A]): Order[A]

Returns a new Order[A] instance that first compares by the first Order instance and uses the second Order instance to "break ties".

Returns a new Order[A] instance that first compares by the first Order instance and uses the second Order instance to "break ties".

That is, Order.whenEqual(x, y) creates an Order that first orders by x and then (if two elements are equal) falls back to y for the comparison.

A Monoid[Order[A]] can be generated for all A with the following properties:

A Monoid[Order[A]] can be generated for all A with the following properties:

empty returns a trivial Order[A] which considers all A instances to be equal.

combine(x: Order[A], y: Order[A]) creates an Order[A] that first orders by x and then (if two elements are equal) falls back to y.

This monoid is also a Band[Order[A]] since its combine operations is idempotent.

See also

Inherited methods

def compare[@specialized A](x: A, y: A)(ev: Order[A]): Int
Inherited from
OrderFunctions
def comparison[@specialized A](x: A, y: A)(ev: Order[A]): Comparison
Inherited from
OrderFunctions
def eqv[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
EqFunctions
def gt[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
PartialOrderFunctions
def gteqv[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
PartialOrderFunctions
def lt[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
PartialOrderFunctions
def lteqv[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
PartialOrderFunctions
def max[@specialized A](x: A, y: A)(ev: Order[A]): A
Inherited from
OrderFunctions
def min[@specialized A](x: A, y: A)(ev: Order[A]): A
Inherited from
OrderFunctions
def neqv[@specialized A](x: A, y: A)(ev: Order[A]): Boolean
Inherited from
EqFunctions
def partialCompare[@specialized A](x: A, y: A)(ev: Order[A]): Double
Inherited from
PartialOrderFunctions
def pmax[@specialized A](x: A, y: A)(ev: Order[A]): Option[A]
Inherited from
PartialOrderFunctions
def pmin[@specialized A](x: A, y: A)(ev: Order[A]): Option[A]
Inherited from
PartialOrderFunctions
def tryCompare[@specialized A](x: A, y: A)(ev: Order[A]): Option[Int]
Inherited from
PartialOrderFunctions

Implicits

Inherited implicits

implicit def catsKernelOrderingForOrder[A](ev: Order[A]): Ordering[A]

Implicitly derive a scala.math.Ordering[A] from a Order[A] instance.

Implicitly derive a scala.math.Ordering[A] from a Order[A] instance.

Inherited from
OrderToOrderingConversion