module Bounded_int_table: Bounded_int_tabletype ('key, 'data) t
type('a, 'b)table =('a, 'b) t
include Equal.S2
val invariant : ('a, 'b) t -> unitval create : ?sexp_of_key:('key -> Sexp.t) ->
num_keys:int ->
key_to_int:('key -> int) -> unit -> ('key, 'data) tcreate ~num_keys ~key_to_int returns a table where the keys can map to 0
.. num_keys-1, according to key_to_int. It is an error if num_keys < 0.
sexp_of_key, if supplied, will be used to display keys in error messages.
val keys : ('key, 'a) t -> 'key listval data : ('a, 'data) t -> 'data listval find : ('key, 'data) t -> 'key -> 'data optionval find_exn : ('key, 'data) t -> 'key -> 'dataval find_or_add : ('key, 'data) t -> 'key -> default:(unit -> 'data) -> 'dataval fold : ('key, 'data) t ->
init:'accum -> f:(key:'key -> data:'data -> 'accum -> 'accum) -> 'accumval iter : ('key, 'data) t ->
f:(key:'key -> data:'data -> unit) -> unitval iter_vals : ('a, 'data) t -> f:('data -> unit) -> unitval filter_mapi : ('key, 'data1) t ->
f:(key:'key -> data:'data1 -> 'data2 option) ->
('key, 'data2) tval filter_map : ('key, 'data1) t ->
f:('data1 -> 'data2 option) -> ('key, 'data2) tval mapi : ('key, 'data1) t ->
f:(key:'key -> data:'data1 -> 'data2) -> ('key, 'data2) tval map : ('key, 'data1) t ->
f:('data1 -> 'data2) -> ('key, 'data2) tval for_alli : ('key, 'data) t ->
f:(key:'key -> data:'data -> bool) -> boolval existsi : ('key, 'data) t ->
f:(key:'key -> data:'data -> bool) -> boolval for_all : ('a, 'data) t -> f:('data -> bool) -> boolval exists : ('a, 'data) t -> f:('data -> bool) -> boolval length : ('a, 'b) t -> intval mem : ('key, 'a) t -> 'key -> boolval remove : ('key, 'a) t -> 'key -> unitval set : ('a, 'b) t -> key:'a -> data:'b -> unitval add : ('a, 'b) t ->
key:'a -> data:'b -> [ `Duplicate of 'b | `Ok ]val add_exn : ('a, 'b) t -> key:'a -> data:'b -> unitval to_alist : ('key, 'data) t -> ('key * 'data) listmodule With_key:functor (Key:sigtypetval to_int :t -> intval t_of_sexp :Sexplib.Sexp.t -> tval sexp_of_t :t -> Sexplib.Sexp.tval bin_t :t Bin_prot.Type_class.tval bin_read_t :t Bin_prot.Read_ml.readerval bin_read_t_ :t Bin_prot.Unsafe_read_c.readerval bin_read_t__ :(int -> t) Bin_prot.Unsafe_read_c.readerval bin_reader_t :t Bin_prot.Type_class.readerval bin_size_t :t Bin_prot.Size.sizerval bin_write_t :t Bin_prot.Write_ml.writerval bin_write_t_ :t Bin_prot.Unsafe_write_c.writerval bin_writer_t :t Bin_prot.Type_class.writerend) ->sig..end
val debug : bool Pervasives.refdebug := true to turn on debugging, including potentially slow invariant
checking.val sexp_of_t : ('key -> Sexplib.Sexp.t) ->
('data -> Sexplib.Sexp.t) ->
('key, 'data) t -> Sexplib.Sexp.tcreate ~num_keys ~key_to_int returns a table where the keys can map to 0
.. num_keys-1, according to key_to_int. It is an error if num_keys < 0.
sexp_of_key, if supplied, will be used to display keys in error messages.
Standard hashtbl functions.
Serialization of a bounded int table using bin_io or sexp preserves num_keys,
but only takes space proportional to the length of the table.
set debug := true to turn on debugging, including potentially slow invariant
checking.