{-# LANGUAGE GeneralizedNewtypeDeriving, UndecidableInstances, FlexibleContexts, GADTs #-}
module Test where
import Universum
newtype Test = Test [Int]
deriving (Container)
Build with stack ghc -- -fwarn-redundant-constraints %, result:
test.hs:6:15: warning: [-Wredundant-constraints]
• Redundant constraint: Eq (Element Test)
• In an expression type signature:
Eq (Element Test) => Element Test -> Test -> Bool
In the expression:
GHC.Prim.coerce
@(Element ([] Int) -> [] Int -> Bool)
@(Element Test -> Test -> Bool)
Universum.elem ::
Eq (Element Test) => Element Test -> Test -> Bool
In an equation for ‘Universum.elem’:
Universum.elem
= GHC.Prim.coerce
@(Element ([] Int) -> [] Int -> Bool)
@(Element Test -> Test -> Bool)
Universum.elem ::
Eq (Element Test) => Element Test -> Test -> Bool
When typechecking the code for ‘Universum.elem’
in a derived instance for ‘Container Test’:
To see the code I am typechecking, use -ddump-deriv
|
6 | deriving (Container)
| ^^^^^^^^^
Using ghc-8.6.3.
Build with
stack ghc -- -fwarn-redundant-constraints %
, result: