[GHC] #11370: Redundant superclass warnings being included in -Wall destroys the "3 Release Policy"
GHC
ghc-devs at haskell.org
Tue Feb 16 04:00:58 UTC 2016
#11370: Redundant superclass warnings being included in -Wall destroys the "3
Release Policy"
-------------------------------------+-------------------------------------
Reporter: ekmett | Owner:
Type: bug | Status: new
Priority: highest | Milestone: 8.0.1
Component: Compiler (Type | Version: 7.10.3
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: #11369, #11429 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by ekmett):
> Does this sentence have an implicit “without losing 3-release
compatibility”?
No.
I mean explicitly that there is code that I have in the wild that can only
work around this by turning off the warning. If you write any class that
only supplies a law then it will always appear to be a "redundant
constraint". GHC doesn't know about the laws.
Examples from real math: Upgrading a braided monoidal category to a
symmetric monoidal category, or needing to know that the Cayley-Dickson
construction that yields the complex numbers from the reals needs a the
ring structure it builds over to be trivially involutive for the lifted
ring structure to be commutative.
These will simply always trigger this warning. In some cases not just for
my library but for users of my library.
Now, I've already patched most of that code to include an explicit, messy
{{{#!hs
#if __GLASGOW_HASKELL__ >= 800
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
#endif
}}}
But it is telling to me that this is the first situation where I've had to
hack in explicit `{-# OPTIONS_GHC #-}` to work around a warning going
haywire.
At present the only other code I can think of where I turn on explicit
`{-# OPTIONS_GHC #-}` is to hack around changes in sharing behavior across
GHC versions that breaks particularly tricky uses of `{-# NOINLINE #-}`.
To get `reflection` to work across a wide enough array of GHC versions I
wind up with a cocktail that looks like:
{{{#!hs
{-# OPTIONS_GHC -fno-cse -fno-full-laziness -fno-float-in #-}
}}}
but that isn't hacking around warnings, but rather buggy code motion that
changes in behavior across GHC versions.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11370#comment:27>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list