.TH "Ephemeron.Kn.Make" 3o 2023-09-18 OCamldoc "OCaml library" .SH NAME Ephemeron.Kn.Make \- Functor building an implementation of a weak hash table .SH Module Module Ephemeron.Kn.Make .SH Documentation .sp Module .BI "Make" : .B functor (H : Hashtbl.HashedType) -> sig end .sp Functor building an implementation of a weak hash table .sp .B "Parameters:" .sp "H" .B Stdlib.Hashtbl.HashedType .sp .sp .PP Propose the same interface as usual hash table\&. However since the bindings are weak, even if .ft B mem h k .ft R is true, a subsequent .ft B find h k .ft R may raise .ft B Not_found .ft R because the garbage collector can run between the two\&. .sp Moreover, the table shouldn\&'t be modified during a call to .ft B iter .ft R \&. Use .ft B filter_map_inplace .ft R in this case\&. .PP .I type key .sp .sp .I type .B 'a .I t .sp .sp .I val create : .B int -> 'a t .sp .sp .I val clear : .B 'a t -> unit .sp .sp .I val reset : .B 'a t -> unit .sp .sp .I val copy : .B 'a t -> 'a t .sp .sp .I val add : .B 'a t -> key -> 'a -> unit .sp .sp .I val remove : .B 'a t -> key -> unit .sp .sp .I val find : .B 'a t -> key -> 'a .sp .sp .I val find_opt : .B 'a t -> key -> 'a option .sp .sp .I val find_all : .B 'a t -> key -> 'a list .sp .sp .I val replace : .B 'a t -> key -> 'a -> unit .sp .sp .I val mem : .B 'a t -> key -> bool .sp .sp .I val iter : .B (key -> 'a -> unit) -> 'a t -> unit .sp .sp .I val filter_map_inplace : .B (key -> 'a -> 'a option) -> 'a t -> unit .sp .sp .I val fold : .B (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b .sp .sp .I val length : .B 'a t -> int .sp .sp .I val stats : .B 'a t -> Hashtbl.statistics .sp .sp .I val to_seq : .B 'a t -> (key * 'a) Seq.t .sp .sp .I val to_seq_keys : .B 'a t -> key Seq.t .sp .sp .I val to_seq_values : .B 'a t -> 'a Seq.t .sp .sp .I val add_seq : .B 'a t -> (key * 'a) Seq.t -> unit .sp .sp .I val replace_seq : .B 'a t -> (key * 'a) Seq.t -> unit .sp .sp .I val of_seq : .B (key * 'a) Seq.t -> 'a t .sp .sp .I val clean : .B 'a t -> unit .sp remove all dead bindings\&. Done automatically during automatic resizing\&. .sp .I val stats_alive : .B 'a t -> Hashtbl.statistics .sp same as .ft B Hashtbl\&.SeededS\&.stats .ft R but only count the alive bindings .sp