Skip to content
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

Support for oneOf in messages #8

Open
clementd-fretlink opened this issue Sep 2, 2021 · 2 comments
Open

Support for oneOf in messages #8

clementd-fretlink opened this issue Sep 2, 2021 · 2 comments

Comments

@clementd-fretlink
Copy link

I'm currently using https://hackage.haskell.org/package/protobuf but would like to use protobuf-simple instead. The missing feature that's blocking me is support for oneOf within a message.

Is there planned work to support it, or maybe there is a not-obvious blocker for this?

If it's "it's not just done yet", i could work on a PR implementing it.

@mrijkeboer
Copy link
Member

Hi @clementd-fretlink,

oneOf is not implemented, because I didn't need it. What's your idea for implementing it, as a sum-type?

@clementd-fretlink
Copy link
Author

Yes. I'm not 100% clear on how haskell identifiers are generated (in order to avoid conflicts).

The oneOf block takes a name parameter, so that could be used in combination with the message name to generate an identifier for the sum type. Same for the constructors of the sum type, that could be built from the message name + field names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants