import Data.Typeable getStaticType :: Typeable a => a -> String getStaticType = show . typeOf main = do putStr(getStaticType(x)) where x = 42 deriving Typeable