[GHC] #11451: Inconsistent warnings for unused binders

GHC ghc-devs at haskell.org
Wed Jan 20 09:44:07 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 simonpj):

 What I'm missing is this: why would it not be more perspicuous to say
 {{{
 Category * (Indexed _)
 }}}
 That doesn't look like mangling to me. It looks like explaining that
 `Indexed` of anything is an instance.
 Similarly
 {{{
 instance MonadReader r m => MonadReader r (StateT _ m)
 }}}
 Is that bad?

 If it is, why do you not object to the warning you get (for unused `y`)
 when you write this?
 {{{
 f x y = x
 }}}
 I'm not arguing against you, just trying to understand.

 Are you also saying that you do not like
 {{{
 type instance F (Maybe _) = Int
 }}}
 and that you want to be able to write
 {{{
 type instance F (Maybe x) = Int
 }}}
 without a warning?  That is, do you see class instances and type-function
 instances the same?

 It would be easier NOT to issue warnings.  But if we do sometimes and not
 at other similar-looking times, I'd like to have a principled explanation.
 Can you give a general rule that informs your choices?

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


More information about the ghc-tickets mailing list