Opaque_mapmodule Key : sig ... endtype 'a t = 'a Key.Map.tinclude Sexplib0.Sexpable.S1 with type 'a t := 'a tval t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a tval sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.tinclude Ppx_compare_lib.Comparable.S1 with type 'a t := 'a tinclude Ppx_compare_lib.Equal.S1 with type 'a t := 'a tinclude Core.Bin_prot.Binable.S1 with type 'a t := 'a tval bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.tinclude sig ... endval bin_size_t : 'a. ('a, 'a t) Bin_prot.Size.sizer1val bin_write_t : 'a. ('a, 'a t) Bin_prot.Write.writer1val bin_read_t : 'a. ('a, 'a t) Bin_prot.Read.reader1val __bin_read_t__ : 'a. ('a, 'a t) Bin_prot.Read.vtag_reader1val bin_writer_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.writerval bin_reader_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.readerval bin_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.tinclude Diffable.S1 with type 'a t := 'a tmodule Diff : sig ... endval erase_key_incrementally :
?data_equal:('data -> 'data -> bool) ->
(('key, 'data, _) Core.Map.t, 'w) Incremental.t ->
get:(key:'key -> data:'data -> 'a) ->
('a t, 'w) Incremental.t @@ portableWhen Opaque_maps are created incrementally we can be smart about insertion and get good performance around insertion and rebalancing.
empty, of_list, and of_array won't give you nice incrementality like erase_key_incrementally, but they are still fine if the primary goal is using the type itself outside of an incremental context.
But if possible, consider erase_key_incrementally.
val empty : _ t @@ portableval of_list : 'a list -> 'a t @@ portableval of_array : 'a array -> 'a t @@ portableinsert_before map ~key elem inserts elem at a position immediately before key in the ordering.
Note: this will never force rebalancing, so avoid using it as the primary method for constructing a t.
insert_after map ~key elem inserts elem at a position immediately after key in the ordering.
Note: this will never force rebalancing, so avoid using it as the primary method for constructing a t.
module Stable : sig ... end