[GHC] #8149: GHC should warn about redundant import of a type name also if one of its record selectors is imported

GHC ghc-devs at haskell.org
Wed Aug 21 11:43:04 UTC 2013


#8149: GHC should warn about redundant import of a type name also if one of its
record selectors is imported
------------------------------------+-------------------------------------
       Reporter:  Lemming           |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Sorry, I have another corner case for a redundant import warning:
 {{{
 module Main where

 import Control.Monad.Trans.Writer (WriterT, runWriterT)

 main :: IO ()
 main = undefined runWriterT
 }}}

 This module will not provoke a warning, although the import of WriterT can
 be omitted. I assume this is because runWriterT is a record selector of
 WriterT and could (or should?) be imported as:
 {{{
 import Control.Monad.Trans.Writer (WriterT(runWriterT))
 }}}
 Since I used runWriterT like a regular function I did not care about its
 record selector feature.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8149>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler




More information about the ghc-tickets mailing list