-
Notifications
You must be signed in to change notification settings - Fork 28
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
Dealing with implicit exports #51
Comments
This seems to kind of defeat the point of weeder, no? Weeder is about working out which code you didn't use, and whether or not you export it doesn't seem important for this decision. Maybe what you're looking for is to add these modules without explicit export lists to your { roots = [ "^My.Module.*$" ], type-class-roots = True } and |
Great question. One of the use cases I used weeder for back before 2.x was to detect unused package dependencies in my package.yaml/cabal files. Upon running the newest weeder I was confronted with 900 weeds resulting from exports being implicit. I think there's a reasonable conversation to be had around whether or not this is an intentional design choice by weeder but I do find it at least unexpected that definitions GHC is treating as exported (by virtue of implicit exports) are not being treated that way by weeder. I suppose this comes down to what the "proper" semantics of a nonexistent export list are. I see 3 possibilities:
I'm open to discussion here, and by no means want to impose my preferences on the project, but I do think that I won't be the only one to encounter confusion around this point. As far as XY problems go, #29 alerted me to the fact that package weed detection was put into GHC directly as of 8.10 and known to be missing in weeder. So in this case maybe what I wanted to use weeder for is not something that currently belongs in its stated set of design goals. If that is the case, then feel free to close this as "won't fix" and we can leave this thread up for posterity. EDIT: formatting |
Currently weeder marks everything as unused when you don't have explicit exports. It'd be nice if it was treated the same way that GHC does making everything "used" if there is no export list.
The text was updated successfully, but these errors were encountered: