flix

0.79.0

Order

Trait for types that have a total order, and its functions.

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

Trait for types that have a total order.

Instances

Primitives
Unit, Bool, Char, Float32, Float64, BigDecimal, Int8, Int16, Int32, Int64, BigInt, String, Vector[a] and tuples of 2 to 15 elements
Non-primitives
Boxed, Chain[a], CopyOption, DelayList[a], DelayMap[k, v], Down[a], Duration, Flag, Identity[a], List[a], Map[k, v], MoveOption, MultiMap[k, v], Nec[a], Nel[a], Option[t], PredSym, RelSym, Result[e, t], RowVar, Set[a], Severity, Size, Style, Validation[e, t], VarSym

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 if x>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

Returns true if and only if x < y.

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.