Numbers : [Haskell-cafe] Number overflow

Carter T Schonwald cartazio at yahoo.com
Thu Jul 12 16:32:11 EDT 2007


Out of curiosity, what ever happened to the proposal a while back to refactor the Num class etc so that the operations would be grouped according to what abstract algebra notions they correspond to?
My understanding was that doing this would make haskell numerics much more sensible. Eg array indexing could be done by any type that is isomorphic to natural numbers etc.

cheers,
-Carter

----- Original Message ----
From: Lennart Augustsson <lennart at augustsson.net>
To: Bulat Ziganshin <Bulat.Ziganshin at gmail.com>
Cc: haskell-cafe at haskell.org
Sent: Thursday, July 12, 2007 4:14:31 PM
Subject: Re: Re[2]: [Haskell-cafe] Number overflow

Of course you should be able to specify what types you want.  But it would be nice if the default was correct rather than fast.

On 7/12/07, Bulat Ziganshin
 <bulat.ziganshin at gmail.com> wrote:
Hello Thomas,

Thursday, July 12, 2007, 3:14:57 AM, you wrote:
> The differences between Int and Integer operations are mostly constant factors.

well, i will be unlucky if in my real-world program Integers would be

used instead of Ints. defaulting provides a great way to solve this
dilemma, so good-for-anyone approach may be: default defaulting to
Integer instead of Int, and use (Num a) instead of Int in all standard
functions such as length. with jhc-like automatic specialization

feature this should provide enough speed

--
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

_______________________________________________

Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070712/545690ba/attachment.htm


More information about the Haskell-Cafe mailing list