Converting Int to Integer
36,314
Solution 1
There is a toInteger
function you can use.
Solution 2
fromIntegral is a good generic way to convert any Integral value into any other Integeral. But as sth said, toInteger works for the case of converting specifically to an Integer.
Solution 3
also, you can use fromIntegral
(since Int
is an Integral
)
Comments
-
marco almost 2 years
Possible Duplicate:
Haskell Error: Couldn't match expected typeInteger' against inferred type
Int'How can I convert
Int
toInteger
in Haskell?