{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE Safe #-} module Main where data R a b = R { x :: a , x :: b} unsafeCoerce :: a -> b unsafeCoerce i = case (R False False){x = i} of R a b -> b main = do print (unsafeCoerce ("abc" :: String) () :: Bool)