Legend:
Library
Module
Module type
Parameter
Class
Class type
Sorts with erased type indices.
This module enables construction of complex data structures on sorts, like maps, sets, etc, e.g.,
let sorts = Set.empty (module Value.Sort.Top)
Since such structures are required to be monomorphic, the sort type index should be removed using the forget function, before a sort could be stored in it.
Note, that the type index is only removed from the meta language (OCaml) type, but is preserved in the value term, so it could be reconstructed (refined) later.
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.
ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort
~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.