-
Notifications
You must be signed in to change notification settings - Fork 60
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
Remove Tuple & Variant #158
Remove Tuple & Variant #158
Conversation
d8e48ba
to
1738c04
Compare
A bit of research has shown that atdgen generates both |
1738c04
to
0bb7265
Compare
Thanks to @hhugo for pointing them out
This seems to be unused in Yojson and Atd
Is this going to kill |
@c-cube I don't think it will break ppx_deriving_yojson too bad, as it encodes tuples as lists and variants as lists with the name of the constructor as first argument, if I remember correctly. Here's the code: https://github.com/ocaml-ppx/ppx_deriving_yojson/blob/61f2d63138ec1efea0a3fb4afa682f40497ec380/src/ppx_deriving_yojson.ml#L115-L148 The biggest (only?) issue will probably be Atd which uses Tuple and Variant, but I believe it would make sense in that case to adopt the same encoding strategy that ppx_deriving_yojson uses. Which has the advantage that the JSON it generates is standard-compliant and thus more interoperable with non-OCaml tools. |
I don't think it's a big issue, and it's a good move forward. Atdgen will make its To see the dependencies on Yojson functions, I used this:
Occurrences such as See ahrefs/atd#412 |
Its not tested anymore and unused by Yojson
@mjambon That's a great list, will be very handy! I've been looking at the I'm thinking that as we're breaking compatibility anyway to become more JSON-compliant, might be sensible to bite the bullet and make the |
ce6e250
into
ocaml-community:master
It has been long time on my mind but now that Yojson 2.x is finally out, we can start looking at the next step, Yojson 3.0 (which I assume should be a fairly minor issue issue, given most consumers probably don't ever deal with
`Tuple
or`Variant
).The code itself is pretty self-explanatory, it mostly eliminates the
TUPLE
andVARIANT
CPPO variables and then deletes some support code.There might be more code to be deleted, like
start_any_variant
/start_any_tuple
. I assume these might be used by atd (need to look into it) so I just removed the part that parses non-standard syntax but maybe it can be removed altogether, along with the unit test that covers it.Closes #104