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
Maybe I'm missing something and there is already a (much better) way to do this...
But when using Either, the JSON serialization does not do what I was hoping for:
Whereas I was actually hoping to get something more like
{"value":"foo"}
{"value":42}
Of course the same goes for decoding.
If there is already a good way to achieve this, I'd be happy to know.
If not, I've been thinking that it could be an option to have an annotation to get this behaviour if wanted. Something along the lines of:
Maybe I'm missing something and there is already a (much better) way to do this...
But when using
Either
, the JSON serialization does not do what I was hoping for:The following simple script
prints:
Whereas I was actually hoping to get something more like
Of course the same goes for decoding.
If there is already a good way to achieve this, I'd be happy to know.
If not, I've been thinking that it could be an option to have an annotation to get this behaviour if wanted. Something along the lines of:
(I'm sure one could come up with a smarter name for it...)
What do you guys think? And if so, could that be something for the hackathon?
The text was updated successfully, but these errors were encountered: