Ephemeron.Ge...le.MakeSeeded(3)
π NAME π
okay so bestie, welcome to the OCaml library manual β this page is Ephemeron.Ge...le.MakeSeeded(3) (yes the title got truncated by the terminal, we love a dramatic ellipsis π) and it's about:
Ephemeron.GenHashTable.MakeSeeded β a functor that builds you an implementation of a hash table, one that uses the container for keeping the information you gave it. that's the whole name, that's the whole vibe. β¨
π¦ Module π¦
Module Ephemeron.GenHashTable.MakeSeeded
literally the module we're talking about, no notes π
β¨ Documentation β¨
π Module MakeSeeded π
here's the signature, copied exactly because I do not play about types:
Module MakeSeeded
: functor (H : sig end) -> sig end
so what is it? it's a functor building an implementation of a hash table that uses the container for keeping the information given. that's the official description, she ate and left no crumbs π«Ά
π Parameters π
"H"β its type issig end. that's it. that's the parameter. a whole parameter and it's giving absolutely nothing (affectionate) π
π Types π
type keyβ the key type. iconic. πtype 'a tβ the table type itself, parameterised over'a. main character energy fr fr π
π Values π
no descriptions in the source for these, so I'm just handing you the signatures exactly as they are β take them, they're yours, don't lose them:
val create : ?random:bool -> int -> 'a tβ here's your constructor, with an optional?random:booland anintπval clear : 'a t -> unitβclear, unit-returning, as advertised π§val reset : 'a t -> unitβreset, also unit-returning β¨val copy : 'a t -> 'a tβcopygives you another'a tπval add : 'a t -> key -> 'a -> unitβaddtakes the table, akey, a'a, returnsunitπΈval remove : 'a t -> key -> unitβremovetakes the table and akey, returnsunitπval find : 'a t -> key -> 'aβfindgives you back a'aπ¦val find_opt : 'a t -> key -> 'a optionβ the option-flavoured one:'a optionπval find_all : 'a t -> key -> 'a listβfind_all, and yes it's a'a listπval replace : 'a t -> key -> 'a -> unitβreplacetakes table,key,'a, and returnsunitβval mem : 'a t -> key -> boolβmemand it's abool, obviously πval iter : (key -> 'a -> unit) -> 'a t -> unitβiterwith that function argument(key -> 'a -> unit)and then the table, returnsunitπ₯val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unitβfilter_map_inplace, function goes(key -> 'a -> 'a option), then the table, returnsunitπval fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bβfold, with(key -> 'a -> 'b -> 'b), the table, a'b, and a'bcomes back out π§val length : 'a t -> intβlength, returns anintπval stats : 'a t -> Hashtbl.statisticsβstats, returnsHashtbl.statisticsβ¨val to_seq : 'a t -> (key * 'a) Seq.tβto_seq, gives you(key * 'a) Seq.tπΈval to_seq_keys : 'a t -> key Seq.tβto_seq_keys, gives youkey Seq.tπval to_seq_values : 'a t -> 'a Seq.tβto_seq_values, gives you'a Seq.tπ¦val add_seq : 'a t -> (key * 'a) Seq.t -> unitβadd_seqtakes a table and a(key * 'a) Seq.t, returnsunitπval replace_seq : 'a t -> (key * 'a) Seq.t -> unitβreplace_seq, same shape: table plus(key * 'a) Seq.t, returnsunitπval of_seq : (key * 'a) Seq.t -> 'a tβof_seqbuilds you an'a tout of a(key * 'a) Seq.tβ
π₯ The two with actual notes π₯
val clean : 'a t -> unitβ remove all dead bindings. and lowkey important: this is done automatically during automatic resizing. so you don't have to, but you can. πval stats_alive : 'a t -> Hashtbl.statisticsβ same asHashtbl.SeededS.statsbut it only counts the alive bindings. undead bindings do not get a vote π
ngl bestie, if you're reaching for clean manually, the resize was gonna handle it anyway β but you do you, queen π
that's the whole page!! this little gift was brought to you by OCamldoc, dated 2026-09-24, filed under Ephemeron.Ge...le.MakeSeeded(3) in the OCaml library manual. go forth and hash, bestie π«Άπβ¨
π¦ where this page comes from
- alpine 3.24: ocaml-doc 4.14.4-r0 Β· LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms