[GHC] #11451: Inconsistent warnings for unused binders

GHC ghc-devs at haskell.org
Mon Jan 18 13:19:31 UTC 2016


#11451: Inconsistent warnings for unused binders
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Good point. They shouldn't be different. It's just that it seems so
 natural to say `instance C (Maybe a)`. But perhaps it shouldn't.

 In any case, this discovery subtly redefines the goal of the warning:

  1. Warn when a type variable is bound explicitly but never used.
  2. Warn when a type variable is bound implicitly but used in only one
 place.

 Refining the goal with point (2) clarifies why there should be no warning
 in `type instance Equals x x = True`.

 What do we think about `length :: [_] -> Int`? According to my goals
 above, that should be the correct type signature, as opposed to `length ::
 [a] -> Int` which should emit a warning.

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


More information about the ghc-tickets mailing list