-
Notifications
You must be signed in to change notification settings - Fork 27
Add support for DUs #70
Comments
I don't think this is in scope for froto as it stands. Im also assuming you mean oneOf types. I have a custom solution to this where the code from froto.parser/serialiser is used with a custom code generator to produce F# record/unions. Its doubtful I could fold this back into this solution as it uses parse tree generation rather than the .Net 1 era generation of type providers which is pretty poor. |
@7sharp9 I have a renewed interest in actually making a |
@ctaggart I still hope I will work on the type provider improvements at some point but it's not my priority at the moment. I guess, extracting the type provider back into a separate repository is the best way to go - you will be able to focus on code generation and maybe at some point I will catch up with the type provider. |
@takemyoxygen Or just add it back here when you have time. I'm fine either way. |
@ctaggart Thats actually what I did, except Im using froto.parser to parse the proto3 file, then using proto.serializer along with quite a lot of the type provider code. Some of it is heavily modified, I also added DU generation for the oneOf fields. The big difference is Im not using any of the type provider mechanism just the provided type structure and quotations as a basis of creating an ast, which is then written to a .fs file. |
@7sharp9 Yes, that is what I want. Any chance you are going to add a PR with that work? |
@ctaggart Its been talked about, I would like to rework more of the quotation parts as they struggle with representing F# without loosing too much information, like infix/prefix on operator calls and also no pattern matching as its removed by the quotation translator. |
Pretty soon the |
I like code generators. Looking forward to seeing it. |
Hi, I didn't find any sample on that one, but would be nice to have serialization of Discriminated Unions
The text was updated successfully, but these errors were encountered: