[GHC] #9939: Warn for duplicate superclass constraints

GHC ghc-devs at haskell.org
Tue Jan 6 15:33:27 UTC 2015


#9939: Warn for duplicate superclass constraints
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                   Owner:
            Type:  feature request   |                  Status:  closed
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.3
      Resolution:  fixed             |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |  typecheck/should_compile/T9939
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * status:  new => closed
 * testcase:   => typecheck/should_compile/T9939
 * resolution:   => fixed


Comment:

 Well, I went ''way'' overboard on this, but it was fun!  Thanks for the
 suggestion.  It showed up masses of unnecessary constraints in the
 compiler itself, and in many libraries, as you can see from
 {{{
 commit c409b6f30373535b6eed92e55d4695688d32be9e
 Author: Simon Peyton Jones <simonpj at microsoft.com>
 Date:   Tue Jan 6 13:46:35 2015 +0000

     Remove redundant constraints from libraries, discovered by -fwarn-
 redundant-constraints

  libraries/array                   |    2 +-
  libraries/base/Data/Data.hs       |    8 +++----
  libraries/base/Data/Foldable.hs   |    4 ++--
  libraries/base/GHC/Arr.hs         |   46
 ++++++++++++++++++-------------------
  libraries/base/GHC/Event/Array.hs |    4 ++--
  libraries/base/GHC/IOArray.hs     |    4 ++--
  libraries/base/GHC/Real.hs        |    6 ++---
  libraries/base/Text/Printf.hs     |    2 +-
  libraries/deepseq                 |    2 +-
  libraries/hoopl                   |    2 +-
  libraries/parallel                |    2 +-
  mk/validate-settings.mk           |    3 +++
 }}}
 and
 {{{
 commit 39337a6d97c853a88fa61d6b12a04eb8c2e5984f
 Author: Simon Peyton Jones <simonpj at microsoft.com>
 Date:   Mon Jan 5 16:57:01 2015 +0000

     Remove redundant constraints in the compiler itself, found by -fwarn-
 redundant-constraints

  compiler/basicTypes/Name.hs                     |    3 ++-
  compiler/cmm/CmmExpr.hs                         |    8 ++++----
  compiler/cmm/Hoopl/Dataflow.hs                  |    2 +-
  compiler/coreSyn/TrieMap.hs                     |    4 ++--
  compiler/deSugar/MatchLit.hs                    |    2 +-
  compiler/ghci/ByteCodeItbls.hs                  |    6 ++++--
  compiler/ghci/Linker.hs                         |    2 +-
  compiler/hsSyn/HsDecls.hs                       |    8 +++-----
  compiler/hsSyn/HsExpr.hs                        |    8 ++++----
  compiler/main/CmdLineParser.hs                  |    2 +-
  compiler/main/GHC.hs                            |   10 +++++++---
  compiler/main/GhcMonad.hs                       |   17 ++++++++++++----
  compiler/main/InteractiveEval.hs                |    3 +--
  compiler/nativeGen/RegAlloc/Graph/SpillClean.hs |   11 ++++-------
  compiler/nativeGen/RegAlloc/Linear/Main.hs      |    4 ++--
  compiler/nativeGen/SPARC/Base.hs                |    2 +-
  compiler/typecheck/TcRnMonad.hs                 |    3 ++-
  compiler/types/CoAxiom.hs                       |    2 +-
  compiler/utils/Binary.hs                        |    2 +-
  compiler/utils/GraphColor.hs                    |    6 +++---
  compiler/utils/GraphOps.hs                      |   24
 ++++++++++-------------
  compiler/utils/GraphPpr.hs                      |    9 ++++-----
  compiler/utils/Maybes.hs                        |    4 ++++
  compiler/utils/Serialized.hs                    |    4 ++--
  compiler/utils/UniqSet.hs                       |    2 +-
 }}}

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


More information about the ghc-tickets mailing list