On Sun, Nov 16, 2008 at 5:35 AM, Thomas Schilling <nominolo@googlemail.com> wrote:
> The relevant flag is: -ddump-minimal-imports
>
> See http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#id2630684

The documentation says this:
-ddump-minimal-imports

   Dump to the file "M.imports" (where M is the module being compiled) a "minimal" set of import declarations. You can safely replace all the import declarations in "M.hs" with those found in "M.imports". Why would you want to do that? Because the "minimal" imports (a) import everything explicitly, by name, and (b) import nothing that is not required. It can be quite painful to maintain this property by hand, so this flag is intended to reduce the labour.

I already know the minimal set of import for the modules.  That's why I mentioned using -Wall; ghc will complain if you import something and don't use it.

The problem is that you can export names that never get used in other modules.  I would like a tool that can look over a project and tell me which exported names are never imported.  These names correspond to things that can be removed from the project.

Thanks,
Jason