Reputation: 704
I have a program that uses both Int
and Integer
, because a few of the functions return results that are quite large. I'm tired of having to use fromIntegral
everywhere and I was wondering if there's a way to get Haskell to ignore the distinction between Int
and Integer
upon compilation.
Upvotes: 5
Views: 301
Reputation: 53665
Solution: remove the Int
s from your program and just use all Integer
s. As noted by geekosaur, you can use the generic functions from Data.List (e.g. genericLength
). If you provide us with your specific program code, then we could give more specific suggestions.
Upvotes: 13