[GHC] #10635: -fwarn-redundant-constraints should not be part of -Wall

GHC ghc-devs at haskell.org
Tue Aug 9 20:56:57 UTC 2016


#10635: -fwarn-redundant-constraints should not be part of -Wall
-------------------------------------+-------------------------------------
        Reporter:  Lemming           |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.11
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #9939, #9973,     |  Differential Rev(s):
  #10100, #10183, #11370             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 It makes some sense to warn, by default, when a signature is less
 polymorphic than it could be.  After all, it's quite possible that the
 programmer didn't realise that the function could be more polymorphic.
 And indeed I found half a dozen cases of redundant constrains in the
 `base` package when I first implemented it.

 But

 * `-fwarn-redundant-constraints` only does part of the job.  It does not
 warn when you use a tighter constraint than necessary, or indeed
 instantiate what could be a polymorphic variable to a specific type.

 * People have argued persuasively that they sometimes want a less
 polymorphic type.

 So:

 * It looks as if we should take it out of `-Wall`.  Would someone like to
 do that, it it hasn't happened already?

 * I'd be open to a design (and a patch) making it possible to say that a
 specific type signature deliberately has redundant constraint.

 Simon

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


More information about the ghc-tickets mailing list