Block.Map
include Ppx_compare_lib.Comparable.S1 with type +'a t := 'a t
val compare :
'a Base__Ppx_compare_lib.compare ->
'a t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S1 with type +'a t := 'a t
val equal : 'a Base__Ppx_compare_lib.equal -> 'a t Base__Ppx_compare_lib.equal
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val sexp_of_compare :
('compare_a -> Sexplib0.Sexp.t) ->
'compare_a compare ->
Sexplib0.Sexp.t
val compare_of_sexp :
(Sexplib0.Sexp.t -> 'compare_a) ->
Sexplib0.Sexp.t ->
'compare_a compare
module Provide_of_sexp (_ : sig ... end) : sig ... end
val empty : 'a t
val merge_endo :
'a t ->
'b t ->
f:(t -> [ `Left of 'a | `Both of 'a * 'b | `Right of 'b ] -> 'a option) ->
'a t
Like merge, but specialized to require f
to preserve the type of the left argument, which enables preserving ==
if f
preserves ==
of every value.
union_absent m1 m2
contains all the bindings of m1
as well as those of m2
for keys not contained by m1
. union_absent m1 m2 == m1
if no bindings from m2
are added.
val is_empty : 'a t -> bool
val is_singleton : 'a t -> bool
val length : 'a t -> int
Find an unspecified binding. Different bindings may be chosen for equivalent maps. O(1)
.
Find an unspecified binding. Different bindings may be chosen for equivalent maps. O(1)
.
find_update k f m
is (found, m')
where found
is find k m
and find k m'
is f found
and find h m'
is find h m
for all other h
.
Find the value bound to the given key if there is one, or otherwise add a binding for the given key and value.
Find the value bound to the given key if there is one, or otherwise add a binding for the given key with value f ()
.
Find and remove binding with minimum key. O(log n)
.
Like map, but specialized to require f
to be an endofunction, which enables preserving ==
if f
preserves ==
of every value.
val iter : 'a t -> f:('a -> unit) -> unit
val values : 'a t -> ('a -> unit) -> unit
val pp_diff :
?pre:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
?suf:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
?sep:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
(Stdlib.Format.formatter -> t -> unit) ->
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> ('a * 'a) -> unit) ->
eq:('a -> 'a -> bool) ->
Stdlib.Format.formatter ->
('a t * 'a t) ->
unit