[GHC] #10117: Change the scheme for reporting redundant imports

GHC ghc-devs at haskell.org
Thu May 19 11:55:22 UTC 2016


#10117: Change the scheme for reporting redundant imports
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.4
      Resolution:                    |             Keywords:  deprecate
                                     |  warning
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I'm fine with making a change like this, if there's user consensus that
 it's a step forward.

 The wiki page says things like "arguably the 'redundant' import here is
 not a big deal, and we shouldn't complain too much about it".  **But what
 is the ''principle'' here?**  Is is this?

  * **Existing principle**: an import item should be reported as redundant
 if it can be deleted without changing the meaning of the program.
  * **New principle**: add "...unless it is the last explicit by-name
 import of an entity."

 Is that the intent?  (It's not quite what the wiki page says because of
 subsumption... but try re-stating the principle, or modify subsumption.)


 I'd rather not try to support two different import-warning plans,
 controlled by a flag. That feels like overkill.  I don't think anyone is
 suggesting that.

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


More information about the ghc-tickets mailing list