Closed martyall closed 4 years ago
.proto
filesSetup.hs
for the wrapper types, by analogy as long as Cat
and Dog
have FromJSON
instance, this works
data Foo = Foo
{ cat :: Cat
, dog :: Dog
} deriving Generic
instance FromJSON Foo where
parseJSON = genericParseJSON defaultOptions
See if we can get a similar high level interface
With regards to @blinky3713:
See if we can get a similar high level interface
At first glance, it seems that most field types have to use the low level types (e.g. Word32
and Int32
, see here), with some flexibility around using another proto message type as a field.
Will look for further options.
This was also quite useful: Low level tutorial
See here for a running example (complete with encode/decode + .proto
generation capabilities):
https://github.com/awakesecurity/proto3-suite
taken from rocketchat:
(1) we still use protofiles for the Network.ABCI.Types.Messages, and this library can still process those so there's no difference there (2) You can still do that for every other type that you want, i.e. ones that maybe you didn't define in your app (3) Currently you need to write protobuf files by hand in order to make tx message types. This requires you to know protobuf well enough to model all your stuff consistently in proto that you eventually want to represent in haskell