Created
April 22, 2020 13:32
-
-
Save jchia/6cc92e686dda4a422832dcb191a2c2b5 to your computer and use it in GitHub Desktop.
GHC redundant constraint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype Sym = Sym { unSym :: ByteString } | |
deriving ( Eq, Generic, Hashable, Ord, IsString, MonoFoldable, Monoid, Semigroup, C.FromField, C.ToField ) | |
type instance Element Sym = Word8 | |
GHC 8.8 Warning: | |
================ | |
• Redundant constraint: Eq (Element Sym) | |
• In an expression type signature: | |
Eq (Element Sym) => Element Sym -> Sym -> Bool | |
In the expression: | |
ghc-prim-0.5.3:GHC.Prim.coerce | |
@(Element ByteString -> ByteString -> Bool) | |
@(Element Sym -> Sym -> Bool) | |
(onotElem @ByteString) :: | |
Eq (Element Sym) => Element Sym -> Sym -> Bool | |
In an equation for ‘onotElem’: | |
onotElem | |
= ghc-prim-0.5.3:GHC.Prim.coerce | |
@(Element ByteString -> ByteString -> Bool) | |
@(Element Sym -> Sym -> Bool) | |
(onotElem @ByteString) :: | |
Eq (Element Sym) => Element Sym -> Sym -> Bool | |
When typechecking the code for ‘onotElem’ | |
in a derived instance for ‘MonoFoldable Sym’: | |
To see the code I am typechecking, use -ddump-deriv | |
| | |
150 | deriving ( Eq, Generic, Hashable, Ord, IsString, MonoFoldable, Monoid, Semigroup, C.FromField, C.ToField ) | |
| ^^^^^^^^^^^^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment