-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Configurable sum encoding #55
Comments
Possible. Would require some thought as to how to make it work well. Not sure whether typeclasses or virtual-classes would be the way to go for this |
Here's my first attempt: https://github.com/tindzk/upickle/tree/change-sumencoding It doesn't work as expected since the implicit is not resolved properly. Do you have any idea how to fix it? Edit: The fix was simple: The |
This is fixed in master https://github.com/lihaoyi/upickle-pprint/blob/master/upickle/shared/src/main/scala/upickle/Api.scala#L7-L40 Now you can define your own upickle bundle and override the CaseR/CaseW sum encoding, swap between the old array-wrapped typetags and type-attribute typetags, and other things. By default I provide |
Great, thanks! |
I need to parse the Pandoc format which is produced via aeson. aeson supports configuring the sum encoding which is done as follows in Pandoc:
Obviously, this consumes more space than the current approach chosen by uPickle:
Would it be possible to not import
annotate
by default, so that I could define it manually?This feature would significantly increase interoperability with other picklers as there doesn't seem to be a common standard on how to serialise classes.
The text was updated successfully, but these errors were encountered: