Specific denotations for pure types

Lennart Augustsson lennart at augustsson.net
Sat Mar 21 06:25:18 EDT 2009


I now think you've been right all along; Integer should have been the
normal numeric type.
Of course, Integer is also machine dependent, but you can have larger
numbers before everything turns to bottom.

The Int type would then be in a implementation dependent library, and
would promise the best speed.

And for types like Int8, Int16, etc, there should be a number of
different types for each of them, because there are at least three
different kinds of overflow semantics which are all useful.

  -- Lennart

On Sat, Mar 21, 2009 at 10:49 AM, Jon Fairbairn
<jon.fairbairn at cl.cam.ac.uk> wrote:
> Conal Elliott <conal at conal.net> writes:
>> Oh -- not one version of Int for 32-bit execution and another version for
>> 64-bit execution?  Seen on #haskell today:
>>
>>   <mux> > maxBound :: Int
>>   <lambdabot>   9223372036854775807
>
> I've always been opposed to having Int "built in" (in
> contrast to having Int32 and Int64 defined in a library
> somewhere). It's much cleaner to have Integer as the
> language integer. A reference implementation of Int8 (for
> brevity!) could be written with (off the top of my head)
>
> data Int8 = Int8 !Bool !Bool !Bool !Bool !Bool !Bool !Bool !Bool
>
> which would specify the semantics exactly.
>
> --
> Jón Fairbairn                                 Jon.Fairbairn at cl.cam.ac.uk
>
> _______________________________________________
> Haskell-prime mailing list
> Haskell-prime at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-prime
>


More information about the Haskell-prime mailing list