
29 Nov
2010
29 Nov
'10
5:34 a.m.
Johan Tibell wrote:
I don't disagree that being able to hash everything is nice, but I don't think it's crucial. My main interest in having a Hashable type class is so we can have containers that can be keyed by hashable things, for the types where this make sense (e.g. string like types where comparison is expensive.) If all that a Hashable type class would give me is the ability to store ByteStrings and Texts in a HashMap, that alone would be enough motivation for having one in my opinion.
Yes I agree. But on the other hand, it would be a shame to provide good built-in hashes only for those, even if we leave the type class open. There is a lot of space between "just strings" and "everything". Thanks, Yitz