rotskoff
rotskoff

Reputation: 704

Can Haskell ignore Ints vs. Integers?

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

Answers (1)

Dan Burton
Dan Burton

Reputation: 53665

Solution: remove the Ints from your program and just use all Integers. 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

Related Questions