TcCoercibleFail.hs:11:8: error: [GHC-18872] • Couldn't match representation of type ‘Int’ with that of ‘()’ arising from a use of ‘coerce’ • In the first argument of ‘($)’, namely ‘coerce’ In the expression: coerce $ one :: () In an equation for ‘foo1’: foo1 = coerce $ one :: () TcCoercibleFail.hs:14:8: error: [GHC-18872] • Couldn't match representation of type: m Int with that of: m Age arising from a use of ‘coerce’ NB: We cannot know what roles the parameters to ‘m’ have; we must assume that the role is nominal • In the first argument of ‘($)’, namely ‘coerce’ In the expression: coerce $ (return one :: m Int) In an equation for ‘foo2’: foo2 = coerce $ (return one :: m Int) • Relevant bindings include foo2 :: m Age (bound at TcCoercibleFail.hs:14:1) TcCoercibleFail.hs:16:8: error: [GHC-18872] • Couldn't match type ‘Int’ with ‘Age’ arising from a use of ‘coerce’ • In the first argument of ‘($)’, namely ‘coerce’ In the expression: coerce $ Map one () :: Map Age () In an equation for ‘foo3’: foo3 = coerce $ Map one () :: Map Age () TcCoercibleFail.hs:18:8: error: [GHC-18872] • Couldn't match representation of type ‘Int’ with that of ‘Down Int’ arising from a use of ‘coerce’ The data constructor ‘Data.Ord.Down’ of newtype ‘Down’ is not in scope • In the first argument of ‘($)’, namely ‘coerce’ In the expression: coerce $ one :: Down Int In an equation for ‘foo4’: foo4 = coerce $ one :: Down Int TcCoercibleFail.hs:21:8: error: [GHC-18872] • Couldn't match representation of type ‘Void’ with that of ‘()’ arising from a use of ‘coerce’ • In the expression: coerce :: Void -> () In an equation for ‘foo5’: foo5 = coerce :: Void -> () TcCoercibleFail.hs:30:9: error: [GHC-18872] • Couldn't match representation of type ‘VoidBad ()’ with that of ‘()’ arising from a use of ‘coerce’ • In the expression: coerce :: (VoidBad ()) -> () In an equation for ‘foo5'’: foo5' = coerce :: (VoidBad ()) -> () TcCoercibleFail.hs:35:8: error: • Reduction stack overflow; size = 201 When simplifying the following type: Age Use -freduction-depth=0 to disable this check (any upper bound you could choose might fail unpredictably with minor updates to GHC, so disabling the check is recommended if you're sure that type checking should terminate) • In the expression: coerce :: Fix (Either Int) -> Fix (Either Age) In an equation for ‘foo6’: foo6 = coerce :: Fix (Either Int) -> Fix (Either Age) TcCoercibleFail.hs:36:8: error: [GHC-18872] • Couldn't match representation of type ‘Either Int (Fix (Either Int))’ with that of ‘()’ arising from a use of ‘coerce’ • In the expression: coerce :: Fix (Either Int) -> () In an equation for ‘foo7’: foo7 = coerce :: Fix (Either Int) -> ()