hashabler icon indicating copy to clipboard operation
hashabler copied to clipboard

Automatically deriving Hashable instances

Open jberryman opened this issue 9 years ago • 1 comments

I'd like to add TemplateHaskell to support automatically deriving Hashable instances for users' datatypes. These should replicate instances for Either, tuples, (), Maybe, but not necessarly [] ( as I haven't quite figured out the rule there).

The only slight trickiness is we want to make sure to only constrain the deriving type's parameters to Hashable when it appears in the RHS (i.e. phantom type parameters should not be constrained to Hashable).

I don't think it's worth using GHC.Generics since it's nearly as awful to use and probably much slower.

jberryman avatar Apr 30 '15 16:04 jberryman

Although it's probably a requirement that I implement a drop-in replacement to hashable's auto-deriving with GHC.Generics if I want this library to have any traction (that way e.g. unordered-containers could switch to this without too much breakage.).

jberryman avatar Jan 19 '16 23:01 jberryman