smlnj / legacy

This project is the old version of Standard ML of New Jersey that continues to support older systems (e.g., 32-bit machines).
BSD 3-Clause "New" or "Revised" License
29 stars 9 forks source link

Additional operations for the `MONO_HASH_TABLE` interface #297

Closed Skyb0rg007 closed 7 months ago

Skyb0rg007 commented 7 months ago

Description

The hash table in the SML/NJ library is missing some operations that would be useful.

signature MONO_HASH_TABLE = sig
  (* ... *)
  (* Same as those in ORD_MAP *)
  val insertWith : ('a * 'a -> 'a) -> 'a hash_table -> Key.hash_key * 'a -> unit
  val findAndRemove : 'a hash_table -> Key.hash_key -> 'a option
end
JohnReppy commented 7 months ago

These have been implemented for 110.99.5. Also added the functions to the HashTable structure.