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

hash-based data structures? #1982

Open
hrhino opened this issue Sep 20, 2018 · 0 comments
Open

hash-based data structures? #1982

hrhino opened this issue Sep 20, 2018 · 0 comments
Assignees

Comments

@hrhino
Copy link
Member

hrhino commented Sep 20, 2018

We've got ISet and ==>>, which are pretty cool, but require an Ord constraint on the key type. Theoretically you can define an ordering for any ADT by considering it a glorified pair of (branch index, values), and use the product ordering. However, given an A => Long hash function, we could implement a hash-trie-based persistent map, such as unordered-containers's.

This could be as simple as closing over an A => Long function, or creating a Hashable typeclass. If we want to go further, having a hash function that accepts a hashing algorithm would allow for potentially more applications of varying strength, although at that point it may be large enough to be considered its own project.

cc @Milyardo @JasnaMRB with whom I chatted last week

@hrhino hrhino self-assigned this Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant