package core
Module Core.OrderingSource
Extends Base.Ordering, intended to make code that matches on the result of a comparison more concise and easier to read.
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
include Ppx_compare_lib.Comparable.S with type t := t
include Ppx_hash_lib.Hashable.S with type t := t
include Sexplib0.Sexpable.S with type t := t
include Base.Equal.S with type t := t
to_int t is:
Less -> -1 Equal -> 0 Greater -> 1
It can be useful when writing a comparison function to allow one to return Ordering.t values and transform them to ints later.