deriving-via-fail5.hs:8:1: error: • Couldn't match representation of type ‘a’ with that of ‘b’ arising from a use of ‘GHC.Prim.coerce’ ‘a’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) ‘b’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) • In the expression: GHC.Prim.coerce @(Int -> Identity b -> ShowS) @(Int -> Foo4 a -> ShowS) (showsPrec @(Identity b)) :: Int -> Foo4 a -> ShowS In an equation for ‘showsPrec’: showsPrec = GHC.Prim.coerce @(Int -> Identity b -> ShowS) @(Int -> Foo4 a -> ShowS) (showsPrec @(Identity b)) :: Int -> Foo4 a -> ShowS When typechecking the code for ‘showsPrec’ in a derived instance for ‘Show (Foo4 a)’: To see the code I am typechecking, use -ddump-deriv In the instance declaration for ‘Show (Foo4 a)’ • Relevant bindings include showsPrec :: Int -> Foo4 a -> ShowS (bound at deriving-via-fail5.hs:8:1) deriving-via-fail5.hs:8:1: error: • Couldn't match representation of type ‘a’ with that of ‘b’ arising from a use of ‘GHC.Prim.coerce’ ‘a’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) ‘b’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) • In the expression: GHC.Prim.coerce @(Identity b -> String) @(Foo4 a -> String) (show @(Identity b)) :: Foo4 a -> String In an equation for ‘show’: show = GHC.Prim.coerce @(Identity b -> String) @(Foo4 a -> String) (show @(Identity b)) :: Foo4 a -> String When typechecking the code for ‘show’ in a derived instance for ‘Show (Foo4 a)’: To see the code I am typechecking, use -ddump-deriv In the instance declaration for ‘Show (Foo4 a)’ • Relevant bindings include show :: Foo4 a -> String (bound at deriving-via-fail5.hs:8:1) deriving-via-fail5.hs:8:1: error: • Couldn't match representation of type ‘a’ with that of ‘b’ arising from a use of ‘GHC.Prim.coerce’ ‘a’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) ‘b’ is a rigid type variable bound by the instance declaration at deriving-via-fail5.hs:(8,1)-(9,24) • In the expression: GHC.Prim.coerce @([] (Identity b) -> ShowS) @([] (Foo4 a) -> ShowS) (showList @(Identity b)) :: [] (Foo4 a) -> ShowS In an equation for ‘showList’: showList = GHC.Prim.coerce @([] (Identity b) -> ShowS) @([] (Foo4 a) -> ShowS) (showList @(Identity b)) :: [] (Foo4 a) -> ShowS When typechecking the code for ‘showList’ in a derived instance for ‘Show (Foo4 a)’: To see the code I am typechecking, use -ddump-deriv In the instance declaration for ‘Show (Foo4 a)’ • Relevant bindings include showList :: [Foo4 a] -> ShowS (bound at deriving-via-fail5.hs:8:1)