[GHC] #11451: Inconsistent warnings for unused binders

GHC ghc-devs at haskell.org
Mon Jan 18 13:05:54 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):

 Let's look more closely at

 {{{
 instance C (Maybe a) where
   op x = x
 }}}

 Simon says that `a` is patently unused. I disagree: `a` is used in the
 instance head! The head of an instance is a type, and thus that `a` is a
 ''use'' site, not a ''binding'' site. The point of confusion is that we
 use usage sites to infer the implicit bindings. Contrast to a class
 declaration, where the type variables are indeed binding sites.

 Separately, I'm agreed with Simon's very last point about warning about
 `x` but not `a`.

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


More information about the ghc-tickets mailing list