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

Feature request: Haskell module namespace for compiled Proto files #174

Open
unclechu opened this issue Oct 23, 2021 · 0 comments
Open

Feature request: Haskell module namespace for compiled Proto files #174

unclechu opened this issue Oct 23, 2021 · 0 comments

Comments

@unclechu
Copy link
Contributor

Take for instance test files from test-files/ directory, if you compile them you get these Haskell modules:

  • TestProto
  • TestProtoImport
  • TestProtoLeadingDot
  • TestProtoNestedMessage
  • TestProtoOneof
  • TestProtoOneofImport
  • TestProtoProtocPlugin

This pollutes top-level module namespace. It would be nice to provide an argument to put the generated Haskell file under some namespace. Sometime like this:

compile-proto-file --moduleNamespace 'Data.Proto.Model'

And then all the modules would be named like this:

  • Data.Proto.Model.TestProto
  • Data.Proto.Model.TestProtoImport
  • Data.Proto.Model.TestProtoLeadingDot
  • Data.Proto.Model.TestProtoNestedMessage
  • Data.Proto.Model.TestProtoOneof
  • Data.Proto.Model.TestProtoOneofImport
  • Data.Proto.Model.TestProtoProtocPlugin

And this would change only Haskell module names and nothing else.

P.S. I’ve tried to implement myself but I couldn’t come up with a good solution yet. I need to get deeper into the code. Maybe you have some ideas of how this can be done?

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

1 participant