#3419: Incorrect "unnecessary import" warning
---------------------------------+------------------------------------------
Reporter: NeilMitchell | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.10.4
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by NeilMitchell):
It seems wrong to make an arbitrary choice. In my example Typeable should
be imported from Data.Typeable usually, because that is the "home module"
- but I certainly wouldn't want GHC to know about home modules. I think
the only sensible answer for a warning is to identify the set of modules
from which only one is required, and list them all - anything else is non-
deterministic.
Of course, the alternative would be to not give a warning at all.
Consider:
{{{
import Data.Typeable
import Data.Data
instance Data Foo where
instance Typeable Foo where
}}}
In this case technically the Typeable import is unnecessary, but I don't
think it's something that should be warned on, as arguably it's better
style.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3419#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs