proto3-suite
proto3-suite copied to clipboard
Configurable proto module prefix
At the moment compile-proto-file executable inherits haskell module namespace from protobuf package namespace. It might be very handy to being able to customize haskell module prefix to avoid namespace conflicts in cases where multiple protobuf APIs/repos/submodules are used in one haskell project.
In general, one way to do this would be via an option directive near the top of the file. What I might suggest is something like an option haskell_module that lets you customize the generated Haskell module name.
This is ok way to do so, and conceptually correct from Google Protobuf standard point of view. In general case Google is promoting custom options for language-specific details. It's unrelated, but options also might be useful for automated wrapping-unwrapping newtypes - protobuf typing in general is poor, for example UTCTime probably will be represented as uint64 in protobuf type system, but then we can specify Haskell rich UTCTime type as an option for the field and automate parsing this way using classes or something like this.
Btw I don't see any Haskell related codes here. If we do any sort of custom options - it's nice to register in this registry
But option for compile-proto-file executable might be very handy as well (and I think relatively easy to do). In our particular use case we have ~200 protobuf files, and adding new custom option to every file might be not the best experience