Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically deriving Hashable instances #2

Open
jberryman opened this issue Apr 30, 2015 · 1 comment
Open

Automatically deriving Hashable instances #2

jberryman opened this issue Apr 30, 2015 · 1 comment

Comments

@jberryman
Copy link
Owner

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
Copy link
Owner Author

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.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant