Dear GHC,
There is something strange in
ghc-pre-4.07 -c -fwarn-unused-imports
about the instance import-export.
-------------------------------------------------------------------
module M where
instance (Num a, Num b) => Num (a,b)
where
fromInteger n = (fromInteger n, fromInteger n)
module N (f) where
import M ()
f :: (Int,Int)
f = fromInteger 2
module K where
import N ()
g :: (Int,Int)
g = fromInteger 2
-------------------------------------------------------------------
Compiling N issues a warning that N uses nothing from M.
While in fact it uses the Num (a,b) instance.
Another question.
If we remove f from N, still N does "use" M to re-export
the instance used further in K.
This was noticed by Kevin Glynn <[EMAIL PROTECTED]>.
Therefore, for M with removed f, does the report
"
N.hs:1:
Warning: Module `M' is imported, but nothing from it is used
"
has to add "except maybe, some instance re-export"
?
------------------
Sergey Mechveliani
[EMAIL PROTECTED]