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

UUID deriving Generic #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pmlodawski
Copy link

Hi!
Can we make UUID deriving Generic?

@hvr
Copy link
Collaborator

hvr commented Mar 11, 2017

@pmlodawski UUID is an abstract data-type, i.e. its constructor is hidden so that its internal implementation can change (e.g. it could e.g. be arch-dependent whether it uses Word32 or Word64) w/o affecting the exposed API. Providing a Generic instance would weaken the abstraction as it would allow to look at the internal representation. What do you want/need a Generic instance for?

@pmlodawski
Copy link
Author

I wanted it to derive ToJSON and FromJSON.

@hvr
Copy link
Collaborator

hvr commented Mar 22, 2017

@pmlodawski ...are you aware aeson versions now have From/ToJSON instances for UUID? :-)

@pmlodawski
Copy link
Author

Yes, but unfortunately latest ghcjs use lts-7.19.
If it is really a problem, I can manage without Generic here so we can close this. ;)

@tekul
Copy link

tekul commented Mar 30, 2017

I have a similar situation where I am using UUID keys in postgresql and would like to also use them in my corresponding data types. The problem is that I am also using those data types with elm-export which requires that you derive Generic for the type.

@hvr hvr mentioned this pull request Jan 29, 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

Successfully merging this pull request may close these issues.

3 participants