-
Notifications
You must be signed in to change notification settings - Fork 178
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
better instance Hashable IntSet? #964
Comments
for a given set of elements, the IntSet representation is unique? E.g., "the mask is the largest position ..." https://github.com/haskell/containers/blob/master/containers/src/Data/IntSet/Internal.hs#L261 Then a hash function could just use structure and contents of the internal representation generically? |
@jwaldmann Correct. |
Correct, but it would be wasteful. The |
Oh yeah, I think there is redundant info there. I'd have to review the representation; it's been a little while. |
Ah yes, the Tip includes the prefix. |
We could offer serialize :: (Word -> r -> r) -> r -> IntSet -> r This could be used to hash efficiently, with |
|
I doubt that's quite what we'd want for |
cross reference to haskell-unordered-containers/hashable#269
The text was updated successfully, but these errors were encountered: