
On 3/24/07, Vivian McPhail
wrote: I agree with Sven, but...
What I want to push is a 'mathematically sound' numeric prelude. A
mgsloan wrote: 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