An Id_table.t
exploits the fact that Probe_id.t
s should be consecutive integers
to make lookups fast
val create : Core_profiler.Probe_id.t list ‑> 'a ‑> ('a, _) t
To create a table you need to specify which Probe_id.t
s are valid cells, and give an empty
value.
This can either be in the form of a list of Probe_id.t
s, or by copying the list from
another Id_table.t
(whose cell contents are ignored)
val init : Core_profiler.Probe_id.t list ‑> f:(Core_profiler.Probe_id.t ‑> 'a) ‑> ('a, _) t
val init_from_map : 'b Core_profiler.Probe_id.Map.t ‑> f:(Core_profiler.Probe_id.t ‑> 'b ‑> 'a) ‑> ('a, _) t
val set_exn : ('a, Core.read_write) t ‑> Core_profiler.Probe_id.t ‑> 'a ‑> unit
val find : ('a, _) t ‑> Core_profiler.Probe_id.t ‑> 'a option
A ('a, read_only) Id_table.t
is meant to look like an Probe_id.Map.t
:
val find_exn : ('a, _) t ‑> Core_profiler.Probe_id.t ‑> 'a
val iter : ('a, _) t ‑> f:(Core_profiler.Probe_id.t ‑> 'a ‑> unit) ‑> unit
val fold : ('a, _) t ‑> init:'accum ‑> f:('accum ‑> Core_profiler.Probe_id.t ‑> 'a ‑> 'accum) ‑> 'accum
val fold_right : ('a, _) t ‑> init:'accum ‑> f:('accum ‑> Core_profiler.Probe_id.t ‑> 'a ‑> 'accum) ‑> 'accum
val to_alist : ('a, _) t ‑> (Core_profiler.Probe_id.t * 'a) list
val map : ('a, _) t ‑> f:(Core_profiler.Probe_id.t ‑> 'a ‑> 'b) ‑> ('b, _) t
val filter_map : ('a, _) t ‑> f:(Core_profiler.Probe_id.t ‑> 'a ‑> 'b option) ‑> ('b, _) t