[Haskell-cafe] Pure hashtable library
bulat.ziganshin at gmail.com
Wed Aug 27 04:09:59 EDT 2008
Wednesday, August 27, 2008, 11:55:31 AM, you wrote:
>> given these constraints, it should be just a 10-20 lines of
>> code, and provide much better efficiency than any tree/trie
> Much better efficiency in what way?
instead of going through many levels of tree/trie, lookup function will just select array element by hash value and look through a few elements in assoc list:
data HT a b = HT (a->Int) -- hash function
(Array Int [(a,b)])
HT.lookup (HT hash arr) a = List.lookup (arr!hash a) a
Bulat mailto:Bulat.Ziganshin at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe