Created
September 3, 2020 09:21
-
-
Save jchia/e9bb569ec0d311268b60346fe135ebb8 to your computer and use it in GitHub Desktop.
Redundant constraint: Eq (Element Prod)
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
import ClassyPrelude | |
newtype Prod = Prod ByteString | |
deriving newtype (Eq, Hashable, Ord, IsString, MonoFoldable, Monoid, Semigroup) | |
type instance Element Prod = Word8 | |
• Redundant constraint: Eq (Element Prod) | |
• In an expression type signature: | |
Eq (Element Prod) => Element Prod -> Prod -> Bool | |
In the expression: | |
coerce | |
@(Element ByteString -> ByteString -> Bool) | |
@(Element Prod -> Prod -> Bool) (oelem @ByteString) :: | |
Eq (Element Prod) => Element Prod -> Prod -> Bool | |
In an equation for ‘oelem’: | |
oelem | |
= coerce | |
@(Element ByteString -> ByteString -> Bool) | |
@(Element Prod -> Prod -> Bool) (oelem @ByteString) :: | |
Eq (Element Prod) => Element Prod -> Prod -> Bool | |
When typechecking the code for ‘oelem’ | |
in a derived instance for ‘MonoFoldable Prod’: | |
To see the code I am typechecking, use -ddump-deriv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment