On Wed, Feb 23, 2011 at 4:56 AM, Victor Nazarov <asviraspossi...@gmail.com> wrote: > What about making Hashable subclass of Eq > > class Eq a => Hashable a where > > I think it's is obvious from Hasable class properties that some kind > of equality is needed and I think it will reduce type class > constraints in actual hash table implementation in > unordered-containers package.
The documentation could perhaps be worded better: if 'a' is also an instance of 'Eq', then the stated property should hold. You can imagine things that can be hashed by not compared for equality. Also, I don't know if type classes are a good way to model sub-typing relationships (see Oleg's email about the Functor/Applicative/Monad proposal). Johan _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe