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

Generic ToJSONKey and FromJSONKey #710

Closed
Lysxia opened this issue Jun 15, 2019 · 0 comments · Fixed by #711
Closed

Generic ToJSONKey and FromJSONKey #710

Lysxia opened this issue Jun 15, 2019 · 0 comments · Fixed by #711

Comments

@Lysxia
Copy link
Collaborator

Lysxia commented Jun 15, 2019

There seems to be no easy way to write common instances of ToJSONKey and FromJSONKey. In the following answer I use Show and Read but that still takes some typing and knowledge about the library.

https://stackoverflow.com/questions/56609201/how-to-use-a-sum-type-as-a-key-in-map-when-using-aeson/56610450#56610450

We should be able to derive this with Generic, defining a gToJSONKeyText and gFromJSONKeyTextParser. Related to issue #463 which suggests this solution as an intermediate step for a harder problem.

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 a pull request may close this issue.

1 participant