warning when exporting imported module

Brian Smith brianlsmith at gmail.com
Wed Jan 12 01:40:51 EST 2005


Hi,

consider some modules:

module A(e,f)
where
e = id
f = e

module B (g,module A)
where
import A
g = f

module C (module A, h)
where
import A
import B
h = g

If you do "ghc --make C -Wall -Werror", then you get 
  Warning: Module `A' is imported, but nothing from it is used
           (except perhaps instances visible in `A')

However, if you remove the import of module A, like this:

module C (module A, h)
where
import B
h = g

you get:
    Unknown module in export list: module 'A'

I think that the first definition of C should be accepted with no
warning. Or, put another way, I think that this warning should only be
issued when the removal of the import would not cause an error.

Thanks,
Brian



More information about the Glasgow-haskell-bugs mailing list