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

Detect definitions used but not reexported #48

Open
pjljvandelaar opened this issue Feb 13, 2019 · 4 comments
Open

Detect definitions used but not reexported #48

pjljvandelaar opened this issue Feb 13, 2019 · 4 comments

Comments

@pjljvandelaar
Copy link

When working in a large project, I don't want to duplicate the dependencies of files/packages I use.
In other words, I would like my abstraction to be complete: no other imports are needed to work with it.

For example, assume a package defines X.
Another package defines a Producer and Consumer of X (and thus depends on the package defining X).
A third package, which wants to use the Producer and Consumer in a decoupled way needs to store the results in buffer of type X.
When the package of the Producer and Consumer does NOT re-export X, the third package must also depends on the package defining X. I consider this dependency unwanted: you must be able to use an interface as is, i.e., in a context where Producer is defined also X must be defined.

However, I was unable to find any tool, including weeder, that performs such a check!

So my question: can weeder check that all necessary definitions are include in the export of a file / package?

@ndmitchell
Copy link
Owner

I don't know if the .hi files contain sufficient information or not - someone needs to verify that.

@ndmitchell ndmitchell changed the title Feature request: Re-export all used definitions Detect definitions used by not reexported Feb 13, 2019
@pjljvandelaar
Copy link
Author

About the title: For me Detect definitions used but not reexported sounds more understandable than Detect definitions used by not reexported

@ndmitchell ndmitchell changed the title Detect definitions used by not reexported Detect definitions used but not reexported Feb 28, 2019
@ndmitchell
Copy link
Owner

@pjljvandelaar the title was a typo :)

@ndmitchell
Copy link
Owner

Weeder 2.0 is being developed at https://github.com/ocharles/weeder so I suggest you go see if that fixes your issues.

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

2 participants