[Haskell-cafe] Integers v ints
schlepptop at henning-thielemann.de
Fri Apr 2 15:03:43 EDT 2010
Jens Blanck schrieb:
> 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 think type defaulting is only an issue for GHCi because in compiled
code you should not let the compiler and reader of your code guess the
type. GHC -Wall warns about uses of default types.
> 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.
You might be interested in
More information about the Haskell-Cafe