You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
There seems to be no easy way to write common instances of
ToJSONKey
andFromJSONKey
. In the following answer I useShow
andRead
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 agToJSONKeyText
andgFromJSONKeyTextParser
. Related to issue #463 which suggests this solution as an intermediate step for a harder problem.The text was updated successfully, but these errors were encountered: