Skip to content

Implement Hashable for UUIDv4 #1

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

janherich
Copy link

@janherich janherich commented Feb 17, 2025

This PR adds Hashable typeclass implementation to the UUIDv4 type, together with adding necessary dependency (unordered-collections) to the spago.yaml descriptor.

I first tried to provide the typeclass instance just in my project where I wanted to use UUIDv4 as keys in the HashMap datastructure, but as the UUIDv4 type constructor is not exported (only the type is), I couldn't do it.

@janherich
Copy link
Author

@garyb Any update on this ? I would really like to use your UUID implementation, but as I'm using the excellent and very performant purescript-unordered-collections in my project (instead of the more common purescript-ordered-collections), this is a deal breaker.

@garyb
Copy link
Owner

garyb commented Jun 21, 2025

My main issue with this is it seems a little backwards for this library to gain the dependency - I've used uuidv4 a lot, but as of yet have never used unordered-collections, it seems odd that those would come along with it.

We were discussing adding Hashable to the prelude at one point, and having it derivable by the compiler, but it seems that stalled: purescript/purescript-prelude#188, purescript/purescript#3446

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

Successfully merging this pull request may close these issues.

2 participants