[Haskell-cafe] Integers v ints

David Menendez dave at zednenem.com
Fri Apr 2 13:34:09 EDT 2010


On Thu, Apr 1, 2010 at 5:27 AM, Jens Blanck <jens.blanck at gmail.com> wrote:
> I was wondering if someone could give me some references to when and why the
> choice was made to default integral numerical literals to Integer rather
> than to Int in Haskell. Also, if you are aware of similar discussions in
> other languages.
> I'd like to use this information to make an analogous case for defaulting
> real numerical literals (well, the literals are likely to be in scientific
> notation, i.e., floating point) to some data type of computable reals rather
> than to floating point Double.

Integer (and Rational) have decidable equality testing. I don't think
the same can be said for computable reals. (Does pi == pi? How about 2
* asin 1?)

-- 
Dave Menendez <dave at zednenem.com>
<http://www.eyrie.org/~zednenem/>


More information about the Haskell-Cafe mailing list