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: reexported-modules should be able to export other-modules #4868

Open
ekmett opened this issue Nov 7, 2017 · 4 comments
Open

Comments

@ekmett
Copy link
Member

ekmett commented Nov 7, 2017

Modules that aren't in exposed-modules aren't allowed to be used as reexported-modules.

If we could re-export other-modules, this would give users a lot more freedom when designing project structure without using internal libraries as shims.

@phadej
Copy link
Collaborator

phadej commented Nov 7, 2017

I'm a confused (re-exporting "hidden" other-modules?), could you write few examples, how'd you like this too look like?

@23Skidoo
Copy link
Member

23Skidoo commented Nov 7, 2017

/cc @ezyang

@ekmett
Copy link
Member Author

ekmett commented Nov 7, 2017

If this worked, then with

library
  other-modules: Foo Bar
  reexported-modules: 
     Foo as Crazy.Deep.Path.Foo,
     Bar as Crazy.Deep.Path.Bar

in the project you can work with Foo.hs and Bar.hs in your top level directory.

To do it today you'd need to use

library private
  exposed-modules: Foo Bar

library
  build-depends: private
  reexported-modules:
     Foo as Crazy.Deep.Path.Foo,
     Bar as Crazy.Deep.Path.Bar 

but private is just an administrative detail, and gets in the way when you already have lots of other little private libraries.

@ezyang
Copy link
Contributor

ezyang commented Nov 8, 2017

I don't think there is any reason we couldn't do this, but I think ghc-pkg will have to be updated to play ball, which means that you're going to need to hit a GHC release to have this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants