data Foo a = Foo Int -- a is a phantom type main :: IO () main = do let e1 = Foo 3 :: Foo Int let e2 = Foo 3 :: Foo Bool -- the next line is illegal, because while they have the same value, -- they have different types if e1 == e2 then putStrLn "same" else putStrLn "different"