[Haskell-cafe] automatically exclude unused modules at compile time

Hong Yang hyangfji at gmail.com
Mon Feb 8 12:25:13 EST 2010


When I turned on "-Wall" knob at compile time, I got a message:

    Warning: Module `System.Cmd' is imported, but nothing from it is used,
               except perhaps instances visible in `System.Cmd'
             To suppress this warning, use: import System.Cmd()

Then I did four experiments as follows at compile time:
1) import System.Environment
2) import System.Environment()
3) import System.Environment(only the functions I used)
4) -- import System.Environment

It turned out that case 1-3) have the size after compilation, and that case
4) has smaller size than the others.

Can we make GHC a little bit more intelligent to automatically exclude
unused modules at compile time as in case 4)? (Am I just too lazy to add
several dashes?)

Thanks,

Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100208/ef87dd32/attachment.html


More information about the Haskell-Cafe mailing list