Module Generic_util_hash

module Generic_util_hash: sig .. end
Extra functions on hashtables

val safe_find : ('a, 'b) Hashtbl.t -> 'a -> ('b -> 'c) -> 'c -> 'c
safe_find, catches the Not_found exception with a default value:
safe_find table key some none =
  try some (Hashtbl.find table key)
  with Not_found -> none

val update : ('a, 'b) Hashtbl.t -> 'a -> ('b -> 'b) -> 'b -> unit
Update a hashtable entry. update table key f x0 will either initialise table[key] with f x0 or update it with f (table[key]).