
On Fri, 2010-11-19 at 10:48 +0100, Gregory Collins wrote:
On Thu, Nov 18, 2010 at 11:05 PM, Johan Tibell
wrote: * A type class for things that can be hashed, Hashable.
class Hashable a where hash :: a -> Word
Shouldn't it be: class Eq a => Hashable a where hash :: a -> Word Or is there useful case where we want to hash something but it cannot be member of Eq?
BTW,
An issue that needs to be resolved is: "Where should this change go?" We have a couple of options:
a) Bring http://hackage.haskell.org/package/hashable into the platform
b) Put the module into base -- probably a -1 for political/logistical reasons
I'd say base - there is Data.HashTable in base so adding function: new' :: Hashable key => IO (HashTable key val) would belong there
c) Put it into containers -- probably a -1 because it would force a containers dependency where there was no containers dependency before.
Any other ideas?
G
Regards