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

GHC ghc-devs at haskell.org
Mon Jun 6 16:50:11 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 acfoltzer):

 Replying to [comment:19 simonpj]:

 I would be happy with this proposal, but given the difficulty of (b) I
 wonder if it's realistic in the short term. A `-Wtype-overly-specific`
 that only checks for unused constraints would be quite confusing.

 A pairing of `-Wredundant-constraints` as described in Richard's proposal,
 and a more narrowly-scoped `-Wunused-constraints` would be more
 straightforward to implement, but the hair-splitting between "redundant"
 and "unused" might be a bit much for someone who's not in the weeds
 already.

 Replying to [comment:17 mboes]:
 > Our particular bug (and I think there are many situations like it), fell
 in the latter category (it was a mistakenly unused constraint).

 Could you say a bit more about what this case looks like? I can't recall
 ever hitting something like it, but it's sounding like I probably have and
 just haven't noticed.

 > I think what would be nice though is if there existed a pragma to mark a
 constraint as explicitly redundant, for those who want that. In general,
 it's nicer to be able to specify things at fine granularity - disabling
 redundant constraint checking at the module level is too coarse a
 granularity. Probably a matter for a separate ticket.

 +1; this would be valuable even if `-Wunused-constraints` gets lifted out
 of `-Wall`.

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


More information about the ghc-tickets mailing list