logo       

warning when exporting imported module: msg#00037

lang.haskell.glasgow.bugs

Subject: warning when exporting imported module

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise