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

GHC ghc-devs at haskell.org
Tue Feb 16 11:34:06 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                     |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 > GHC-8.0 does not warn about any of these two. Should it?

 Indeed GHC 8.0 warns that the `a ~ b` constraint is redundant. This is
 arguably wrong and I've opened #11582 for this case. This is almost
 certainly not the last example of this sort that we will find.

 However, I suspect that `-Wredundant-constraints` will help more users in
 the situation that mboes describes than it would hurt users with the cases
 you describe if enabled in `-Wall`. It doesn't seem unreasonable to me to
 require users writing code like `asTypeOf1` to explicitly disable this
 warning. At the moment this can only be done on with module-level
 granularity but hopefully in the future we will have
 [[Design/LocalWarningPragmas|mechanisms]] for silencing warnings with
 greater precision.

 Regardless, your points have demonstrated that there are some tricky
 issues here. It would be helpful if you could collect these thoughts on
 [[Design/Warnings/RedundantConstraints]].

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


More information about the ghc-tickets mailing list