
11 Jan
2009
11 Jan
'09
10:27 a.m.
Hi, if im calling (on the console) "typeOf 1" after importing Data.Typeable, i will gain "Integer", as i expected, but if i do so in code which is to compile, then there raises an error ------------ import Data.Typeable main= print (typeOf 1) ------------ $ ghc -c DT.hs $ ghc -c DT.hs DT.hs:4:15: Ambiguous type variable `t' in the constraints: `Num t' arising from the literal `1' at DT.hs:4:15 `Typeable t' arising from a use of `typeOf' at DT.hs:4:8-15 Probable fix: add a type signature that fixes these type variable(s) what can i do, to solve this problem? Regards