41

Possible Duplicate:
Haskell Error: Couldn't match expected type Integer' against inferred typeInt'

How can I convert Int to Integer in Haskell?

1

3 Answers 3

75

There is a toInteger function you can use.

Sign up to request clarification or add additional context in comments.

Comments

18

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.

Comments

5

also, you can use fromIntegral (since Int is an Integral)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.