protobuf-simple
protobuf-simple copied to clipboard
Support for `oneOf` in messages
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.
Hi @clementd-fretlink,
oneOf
is not implemented, because I didn't need it. What's your idea for implementing it, as a sum-type?
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.