[Haskell-cafe] Re: Why the Prelude must die
benjamin.franksen at bessy.de
Wed Mar 28 17:22:34 EDT 2007
> On 3/24/07, Vivian McPhail <vivian.mcphail at paradise.net.nz> wrote:
>> I agree with Sven, but...
>> What I want to push is a 'mathematically sound' numeric prelude. A
>> numerical prelude should have bona fide mathematical obects like groups,
>> rings, and fields underlying common numerical classes. It would be
>> to the student who discovered that the particular data type he is using
>> an inhabitant of a known class and can thus take advantage of known
>> properties, presupplied as class methods. Reasoning and communication
>> programs, data types, and functions would be enhanced.
> One problem with that is that the instances are often times not
> mathematically sound - Int and Double certainly aren't.
Int is algebraically sound as a factor ring Z/nZ with n=2**k, k the number
of bits (which could be implementation defined). Unfortunately the order
inherited from Integer is not compatible with the algebra...
More information about the Haskell-Cafe