Order

trait Order[a: Type] with Eq[a]Source

Signatures

def compare(x: a, y: a): Comparison with Order[a] Source

Returns Comparison.LessThan if x < y, Equal if x == y or Comparison.GreaterThan ifx>y`.

Trait Definitions

def greater(x: a, y: a): Bool with Order[a] Source

Returns true if and only if x > y.

def greaterEqual(x: a, y: a): Bool with Order[a] Source

Returns true if and only if x >= y.

def less(x: a, y: a): Bool with Order[a] Source
def lessEqual(x: a, y: a): Bool with Order[a] Source

Returns true if and only if x <= y.

def max(x: a, y: a): a with Order[a] Source

Returns the maximum of x and y.

def min(x: a, y: a): a with Order[a] Source

Returns the minimum of x and y.

Module Definitions

def maxBy(cmp: a -> (a -> Comparison), x: a, y: a): a Source

Returns the maximum of x and y according to the given comparator cmp.

def minBy(cmp: a -> (a -> Comparison), x: a, y: a): a Source

Returns the minimum of x and y according to the given comparator cmp.

def thenCompare(c1: Comparison, c2: Lazy[Comparison]): Comparison Source

Lazily combines two comparisons.

If c1 is either Comparison.LessThan or Comparison.GreaterThan then c2 is never evaluated.