Skip to content

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

@unclechu

Description

@unclechu

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions