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

GHC ghc-devs at haskell.org
Mon Feb 15 21:24:50 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 Lemming):

 Replying to [comment:4 bgamari]:
 > Lemming, Perhaps it would help have introduce a mechanism for telling
 the compiler "I intentionally do not use this constraint" on either a per-
 context or per-class basis?

 On the one hand, I would say, Yes, because we have ways to flag
 intentionally unused imports and unused identifiers and that works nicely.
 On the other hand, I wonder whether we can treat constraints and imports
 and identifiers the same way. What does it mean at all to have a redundant
 constraint? E.g.
 {{{
 asTypeOf :: a -> a -> a
 asTypeOf x _ = x
 }}}
 has not the most general type. Is this a redundant constraint? I can write
 it more explicitly:
 {{{
 asTypeOf1 :: (a ~ b) => a -> b -> a
 asTypeOf1 x _ = x
 }}}
 GHC-8.0 does not warn about any of these two. Should it?

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


More information about the ghc-tickets mailing list