fork download
  1. import Data.Typeable
  2. main = do
  3. let x = 42
  4. putStr(showsTypeRep(typeOf(x)))
  5.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:4:10:
    Couldn't match expected type `String' against inferred type `ShowS'
    In the first argument of `putStr', namely
        `(showsTypeRep (typeOf (x)))'
    In the expression: putStr (showsTypeRep (typeOf (x)))
    In the expression:
        do let x = 42
           putStr (showsTypeRep (typeOf (x)))
stdout
Standard output is empty