[Haskell-cafe] Find unused exports

Jason Dagit dagit at codersbase.com
Sun Nov 16 20:48:27 EST 2008


On Sun, Nov 16, 2008 at 5:10 PM, Michael D. Adams <mdmkolbe at gmail.com>wrote:

> Within a set of modules, the minimal imports also give you the minimal
> exports since each minimal export is required because it is imported
> somewhere.  Just compile all your modules with -ddump-minimal-imports,
> then cat all your "*.import" files together and sort the result.  The
> minimal exports for module Foo will be listed as several lines of the
> form "import Foo(x,y,z)", etc.  From there on it's just a bit of text
> munging to get it into your export list code (about two lines of
> perl).


Alright, that's the same manual process I do now.  I didn't use
-ddump-minimal-imports before because I didn't know about it and we maintain
sufficiently minimal imports already.  That and I used emacs macros instead
of perl because I already know how to use emacs :)

If I take the time to automate this I wonder if it's a worthwhile tool to
upload to hackage.  Sounds like others have been doing this sort of thing.

Now if I just had a round touit...

Thanks everyone!

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


More information about the Haskell-Cafe mailing list