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

Configurable proto module prefix #146

Open
tim2CF opened this issue Mar 30, 2021 · 4 comments
Open

Configurable proto module prefix #146

tim2CF opened this issue Mar 30, 2021 · 4 comments

Comments

@tim2CF
Copy link
Collaborator

tim2CF commented Mar 30, 2021

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.

@Gabriella439
Copy link
Contributor

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.

@tim2CF
Copy link
Collaborator Author

tim2CF commented Mar 31, 2021

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.

@tim2CF
Copy link
Collaborator Author

tim2CF commented Mar 31, 2021

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

@tim2CF
Copy link
Collaborator Author

tim2CF commented Mar 31, 2021

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

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