Hans Aberg <mailto:[EMAIL PROTECTED]> wrote:
> From a generalistic point of view (not necessarily in the context of
> Haskell), I am inclined to believe that the Int type should be replaced by
> a type named Binary(32) or something. This binary type should know how to
> do +, -, signed/unsigned multiplication/division and typical fixed sized
> binary operations (Boolean, shifts). This type can then be used as a
> building brick for fast code and specialized binary applications.
Once again, I refer people to the documentation for the shared Hugs-GHC
libraries.
ftp://haskell.org/pub/reid/libs971028/libs.html
As well as all the usual mutable stuff, these libraries provide the following
types:
Int8, Int16, Int32, Int64 -- signed arithmetic modulo 2^{8,16,32,64}
Word8, Word16, Word32, Word64 -- unsigned arithmetic modulo 2^{8,16,32,64}
and a Bits library providing and, or, shift, etc on all these types.
These libraries are implemented in Hugs and are being implemented in GHC
as I write.
Alastair Reid