Ordering
equal
RES
let equal: floatfromInt
RES
let fromInt: int => floatfromInt(n) converts an integer comparison result into an ordering.
Examples
RESOrdering.fromInt(-5) == Ordering.less
Ordering.fromInt(0) == Ordering.equal
Ordering.fromInt(3) == Ordering.greater
greater
RES
let greater: floatignore
RES
let ignore: t => unitignore(ordering) ignores the provided ordering and returns unit.
This helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further.
invert
RES
let invert: float => floatinvert(ordering) flips the ordering result (less becomes greater and vice versa).
Examples
RESOrdering.invert(Ordering.less) == Ordering.greater
Ordering.invert(Ordering.equal) == Ordering.equal
isEqual
RES
let isEqual: float => boolisEqual(ordering) returns true when ordering equals Ordering.equal.
Examples
RESOrdering.isEqual(Ordering.equal) == true
Ordering.isEqual(Ordering.greater) == false
isGreater
RES
let isGreater: float => boolisGreater(ordering) returns true when ordering equals Ordering.greater.
Examples
RESOrdering.isGreater(Ordering.greater) == true
Ordering.isGreater(Ordering.less) == false
isLess
RES
let isLess: float => boolisLess(ordering) returns true when ordering equals Ordering.less.
Examples
RESOrdering.isLess(Ordering.less) == true
Ordering.isLess(Ordering.equal) == false
less
RES
let less: floatt
RES
type t = floatOrdering values represent the result of a comparison: less, equal, or greater.