Add a warning for reexports
Motivation
Re-exports can be detrimental to build times in large projects, but as they do not differ syntactically from normal exports, they are difficult to automatically identify. For instance if you wanted to enforce a policy that only certain modules may re-export identifiers.
For context, they can be detrimental to build types because they can cause unnecessary modules to be added to the dependencies of modules. Eg, Suppose we have modules A, B, E, and C. E re-exports the identifiers from A and B. C imports E but only uses identifiers from A. GHC now has to build A, B, and E before it can even start building C, but a simple refactor to import from A directly would reduce this to just requiring A.
Proposal
Add a warning called -Wreexports
that gives a warning if a module re-exports an identifier that is not defined in that module. This should be off by default and not enabled by Wall as this is quite a niche thing that doesn't necessarily indicate that anything is wrong.