package core

  1. Overview
  2. No Docs
Industrial strength alternative to OCaml's standard library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.16.2.tar.gz
md5=bcac85c0ec5795ccabf1dccf0968ecd9
sha512=2e68556773549e0bf302c8733c9fc57df3c0fd73a1b547dc17097f74c5b5482c816ef89853b437e49452da7c124ef32a8a0de0dff64d71145b2ab11befbe5bb2

doc/core/Core/Comparator/index.html

Module Core.ComparatorSource

Extends Base.Comparator, providing a type-indexed value that allows you to compare values of that type.

Sourcetype ('a, 'witness) t = private ('a, 'witness) Base.Comparator.t = {
  1. compare : 'a -> 'a -> Base.Int.t;
  2. sexp_of_t : 'a -> Base.Sexp.t;
}
Sourcetype ('a, 'b) comparator = ('a, 'b) t
Sourcemodule type S = Base.Comparator.S
Sourcemodule type S1 = Base.Comparator.S1
Sourcemodule type S_fc = Base.Comparator.S_fc
Sourceval make : compare:('a -> 'a -> int) -> sexp_of_t:('a -> Base.Sexp.t) -> (module S_fc with type comparable_t = 'a)

make creates a comparator witness for the given comparison. It is intended as a lightweight alternative to the functors below, to be used like so:

  include (val Comparator.make ~compare ~sexp_of_t)

Make creates a comparator value and its phantom comparator_witness type for a nullary type.

Make1 creates a comparator value and its phantom comparator_witness type for a unary type. It takes a compare and sexp_of_t that have non-standard types because the Comparator.t type doesn't allow passing in additional values for the type argument.

Sourcemodule type Derived = Base.Comparator.Derived

Derived creates a comparator function that constructs a comparator for the type 'a t given a comparator for the type 'a.

Sourcemodule type Derived2 = Base.Comparator.Derived2

Derived2 creates a comparator function that constructs a comparator for the type ('a, 'b) t given comparators for the type 'a and 'b.

Sourcemodule type Derived_phantom = Base.Comparator.Derived_phantom
Sourcemodule Derived_phantom = Base.Comparator.Derived_phantom

Derived_phantom creates a comparator function that constructs a comparator for the type ('a, 'b) t given a comparator for the type 'a.

Sourcemodule type Derived2_phantom = Base.Comparator.Derived2_phantom
Sourcemodule Derived2_phantom = Base.Comparator.Derived2_phantom

Derived2_phantom creates a comparator function that constructs a comparator for the type ('a, 'b, 'c) t given a comparator for the types 'a and 'b.

The following module types and functors may be used to define stable modules

Sourcemodule Stable : sig ... end