Ordering

A value of the built-in type Ordering is a value denoting that something is “less than”, “equal to”, or “greater than” something else:

type Ordering
  | Less
  | Equal
  | Greater

compareInt : Int -> Int -> Ordering

compareFloat : Float -> Float -> Ordering

compareDateTime : DateTime -> DateTime -> Ordering

Examples

val a = compareInt 3 6
//    = Less
val b = compareFloat 4.5 4.5
//    = Equal
val c = compareDateTime #2017-12-24T12:00:00Z# #2017-10-11T10:00:00Z#
//    = Greater