[Haskell-cafe] Re: Why the Prelude must die

Benjamin Franksen benjamin.franksen at bessy.de
Wed Mar 28 17:22:34 EDT 2007


mgsloan wrote:
> 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
proper
>> numerical prelude should have bona fide mathematical obects like groups,
>> rings, and fields underlying common numerical classes.  It would be
>> edifying
>> to the student who discovered that the particular data type he is using
is
>> an inhabitant of a known class and can thus take advantage of known
>> properties, presupplied as class methods.  Reasoning and communication
>> about
>> 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...

Cheers
Ben



More information about the Haskell-Cafe mailing list