insert :: Hashtable -> key -> val -> Hashtable
lookup :: Hashtable -> key -> a
etc.
Thanks,
Rob Hoelz
_______________________________________________
Haskell mailing list
Has...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell
That would be the signature for immutable hashtables. The old and new ones
would be distinct and could co-exist. Building an immutable hashtable on top of
Data.Array or Data.Map would be fairly easy.
Data.Hashtable is a mutable hashtable. After an insert the old Hashtable no
longer exists -- there is only the new one. Thus operations needs to be
ordered. Rightfully, there should be a Data.Hashtable.ST as well.
The standard Haskell libraries have yet to include one of the type class
approaches to immutable collections and have very little in the way of mutable
data structures.
The former is probable due to lack of standardization of MPTC / fundeps /
associated types. The latter is due to both lack of sufficient interest and the
same lack of a standard for fancier type classes.