Add a warning for imports of re-exports
If I have a module A which exposes Foo, and then a module B which exposes A.Foo and also Baz, then if module C imports B just to get Foo, now C unnecessarily depends on stuff from B!
We see this pattern all of the place in ghc-internal. Since `ghc-internal` used to be `base`, a lot of the modules used to be user-facing modules with re-exports. But then other modules import from these modules. This linearises, lengthens and in general makes worse the module graph of `ghc-internal`.
It would be great to lint for re-exports somehow. We don't really need re-exports in `ghc-internal`. Those can live in `base`.
A few years ago I asked for a warning for re-exports https://gitlab.haskell.org/ghc/ghc/-/issues/22059, but people weren't keen on that as a compiler feature.
What other options do we have here?
issue