[Haskell-cafe] Find unused exports

Jason Dagit dagit at codersbase.com
Sun Nov 16 14:51:21 EST 2008

On Sun, Nov 16, 2008 at 5:35 AM, Thomas Schilling <nominolo at googlemail.com>
> The relevant flag is: -ddump-minimal-imports
> See

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20081116/2ab89811/attachment.htm

More information about the Haskell-Cafe mailing list