RFC: Adding a Hashable type class and HashMap/HashSet data types
nominolo at googlemail.com
Mon Nov 22 20:49:11 EST 2010
On 20 November 2010 19:26, Yitzchak Gale <gale at sefer.org> wrote:
> Johan Tibell wrote:
>> * Instances of Hashable for common types, in particular ByteString and Text.
> And of course, all of the numeric types, unit, and Bool, Maybe, and Either.
> More interesting are Maybe, Either, lists, tuples, Data.Map, Data.Set,
> etc. These are far from trivial; I did some work on it for Python. If you
> think you can just do something fairly simple and reasonable and hope
> that it will have the right statistical properties, I promise you that it won't
Are you referring to the hash function or to the fact that you want
structurally different types to map to different hashes? I.e., hash
(Data.Binary.encode x) probably would lead to unintended collisions.
E.g., isomorphic values might get the same hash, right?
More information about the Libraries