
On Thu, 11 Aug 2011, Sebastian Fischer wrote:
[switched to Cafe]
On Wed, Aug 10, 2011 at 11:46 PM, Henning Thielemann
wrote: On Wed, 10 Aug 2011, Paterson, Ross wrote:
Yet another restructuring of the Prelude numeric classes on algebraic lines, proposed for a revision of the Haskell Prelude:
A nice lightweight design, both in terms of the use of type extensions and import dependencies, that should people encourage to use it, when they are afraid of changing to a more radical approach like numeric-prelude. I would have prefered the name AdditiveGroup to AbelianGroup, since with '+' and '-' and '0' I associate more than just the laws of an Abelian group. The multiplicative group of rational numbers is abelian, too.
I'm curious: what laws do you have in mind for '+', '-', and '0' that do not hold in the multiplicative group of rational numbers with
(+) = (*); (-) = (/); 0 = 1
?
I do not associate more laws, but I expect to use zero for things that are somehow related to numbers. And I also do not want to use (+) and (-), say, for rational numbers to mean (*) and (/). That's not an algebraical reason, but a matter of error prevention and expectations. It's the same reason, why I would not want to define an Ord instance for Complex numbers. Complex numbers can be ordered, but a < (b::Complex Rational) will be a mistake in many cases, I guess.