Skip to content

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

@janherich
Copy link
Author

I agree that having Data.Hashable typeclass in Prelude would be better, no need to pull-in full dependency. I will see how I can help to move that forward, closing the PR.

@janherich janherich closed this Jun 23, 2025
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