-
Notifications
You must be signed in to change notification settings - Fork 77
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
Generic runtime representation #106
Comments
@tim2CF: There is not a generic representation, as far as I know. |
I meant not exactly GHC.Generics, but some sort of protobuf AST which can be used to fold protobuf messages in generic way. Or at least some sort of protobuf reflection API which can give information about message field types and indexes in terms of Haskell. |
@tim2CF: Yeah, I understand what you mean, but I don't think there is such a representation. Protobuf is not like CBOR or JSON so there is no standard generic AST for the data. |
Well, maybe not data itself, but schema of data. Information about, types, names and indexes of messages in form of Haskell terms. Protobuf reflection API exists in some implementations. I'm not sure is it part of standard itself or not, but you can take a look for example to other Haskell implementation here https://hackage.haskell.org/package/proto-lens-0.7.0.0/docs/Data-ProtoLens-Message.html#g:1 It's quite useful in some cases, for example for generalized Arbitrary instance for any protobuf message |
@tim2CF: Oh, so if all you need is the AST of the |
@Gabriel439 cool, thanks for the link! I'm building library for signing/verifying protobuf messages in deterministic way, and wanna to support both Haskell implementations, because I'm using both of them. We just started this library, but eventually it will be there https://github.com/coingaming/signable In general for me more preferable way is to get proto information through type class instance, like in proto-lens (I basically can give https://hackage.haskell.org/package/proto3-suite-0.4.0.0/docs/Proto3-Suite-Class.html#v:dotProto |
@tim2CF: Yeah, I believe the |
Hello! Is there some sort of generic runtime representation of protobuf types generated from protobuf files? Something similar to this (but for protobuf) https://hackage.haskell.org/package/aeson-1.5.3.0/docs/Data-Aeson.html#t:Value
The text was updated successfully, but these errors were encountered: