Data.HashTable and duplicate keys

George Russell ger at
Tue Sep 28 07:48:54 EDT 2004

Einar wrote (snipped):
 > I recently noticed that Data.HashTable silently
 > accepts duplicate keys and keeps all the values.
 > This is very counterintuitive from the interface
 > and makes updating a hashtable quite tedious
 > (lookup + delete + insert).

Gosh, I'm glad *someone* told me of this bizarre behaviour.
Why on earth hash tables should mimic association lists of
all things is a mystery to me.  (Should GHC also insert
delay loops to simulate their poor performance?)

Sigh, off I go to fix my code.  Just as well I only use
hash tables in one place.

More information about the Libraries mailing list