warning when exporting imported module

Simon Peyton-Jones simonpj at microsoft.com
Mon Feb 7 07:10:17 EST 2005


Quite right.  Actually it turns out that there are several deficiencies
in GHC's unused-import reporting, of which this is only one, alas.  I've
improved the situation for this particular case, though, and added a
test for it.  Thanks for pointing it out.

SImon

| -----Original Message-----
| From: glasgow-haskell-bugs-bounces at haskell.org
[mailto:glasgow-haskell-bugs-
| bounces at haskell.org] On Behalf Of Brian Smith
| Sent: 12 January 2005 06:41
| To: glasgow-haskell-bugs at haskell.org
| 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
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs



More information about the Glasgow-haskell-bugs mailing list