At 09:40 +0100 98/10/07, S.J.Thompson wrote:
>1. There is a meta argument that we simply have not reached a consensus on
>this issue: there are options -- such as a `word' view of Int -- which need
>to be looked at, and there are details to do with libraries which need to be
>niggled over. It therefore seems likely that whatever decision is taken now,
>it will be substantially changed in Haskell 2, and so we should stick with
>what we have and try to get it right for Haskell 2.
If this is the case, the best strategy seems to keep things were they
are, think carefully about what to do with the Int type, and then make the
change just once.
At 10:41 -0400 98/10/06, Philip Wadler wrote:
> I thought at the ICFP Haskell meeting we agreed
>on the following types:
>
> length :: Integral i => [a] -> i
> take, drop :: Integral i => i -> [a] -> [a]
> showsPrec :: (Show a, Integral i) => i -> a -> ShowS
>
>and so on. These have the advantage that they work with either Int or
>Integer.
I think that this idea of Integral unifying Integer and binary types such
as Int is very nice.
However, in this context, it seems to be used merely to make up for the
fact that one cannot decide whether to use Integer's or Int's: Then
question is if there is a real efficiency difference between Integer's or
Int's in this context; it is not only a question if there is a time factor
3 or something when properly optimized but how often these operations are
used in a standard program that needs to be very fast.
So I think that one perhaps just can forget about the Int's in this
context just using Integer's.
The uses for Int I think would be in the context of special bit
manipulations, like a special Binary type as I suggested, or if one writes
programs with C code and Haskell code working together. (In this latter
context, it is evidently so that C and C++ do not specify how the int's
should be implemented: It could be implemented as a two's complement or and
unsigned with a sign bit.)
Hans Aberg
* Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
* Home Page: <http://www.matematik.su.se/~haberg/>
* AMS member listing: <http://www.ams.org/cml/>