[GHC] #11369: Suppress redundant-constraint warnings in case of empty classes
GHC
ghc-devs at haskell.org
Thu Jan 7 13:40:26 UTC 2016
#11369: Suppress redundant-constraint warnings in case of empty classes
-------------------------------------+-------------------------------------
Reporter: hvr | Owner: simonpj
Type: bug | Status: new
Priority: highest | Milestone: 8.0.1
Component: Compiler (Type | Version: 8.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by ekmett):
Note: Suppressing only in the absence of superclasses means that any class
constraint that just gives you a law will **always** spring this warning.
{{{#!hs
class Bifunctor p => Braided p where
braid :: p a b -> p b a
-- | @braid . braid = id@
class Braided p => Symmetric p
swap :: Symmetric p => p a b -> p b a
swap = braid
}}}
(This code is slightly simplified from
http://hackage.haskell.org/package/categories-1.0.7/docs/Control-Category-
Braided.html)
One "solution" here is to move `swap` into the `Symmetric` class, but then
you need to worry about it being overridden to be different than `braid`,
which operationally can't happen in the current approach.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11369#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list