packages feed

inspection-testing-0.6.3: examples/UnsafeCoerce.hs

{-# LANGUAGE TemplateHaskell #-}
module UnsafeCoerce where

import Test.Inspection
import Unsafe.Coerce
import GHC.Exts

lhs :: Any -> Any
lhs a = unsafeCoerce $ unsafeCoerce a + (1 :: Int)

rhs :: Int -> Int
rhs = (+ 1)

inspect $ 'lhs =/= 'rhs
inspect $ 'lhs ==- 'rhs

main :: IO ()
main = return ()