Proposal: Remove Show and Eq superclasses of Num

Paterson, Ross R.Paterson at
Fri Oct 14 00:47:48 CEST 2011

Tyson Whitehead writes:
> I was looking through YAP a bit and was not certain about what was there only
> for compatibility as apposed to because it was also still good.
> Am I correct in understanding, if you were starting from scratch:
> - Num, Fractional, Real, and Integral would get axed, and
> - EuclidianDomain, Ring, and Field would form the base.

Fractional would be superfluous, but people would probably still want
to overload abs, signum, toRational, quot, rem and toInteger for the
standard numeric types.  Maybe the classes would have different names.

> Would you then leave RealFrac, Floating, and RealFloat with superclasses
> - RealFrac: Field
> - Floating: Field
> - RealFloat: RealFrac, Floating
> or overhaul them too somehow?  The choice of functions for Floating has always
> seemed somewhat arbitrary.  Not so much that I'm saying the the choice of
> basic transcendentals was bad, but the fact a choice had to be made seems bad.

I don't know how those classes should be changed.  Certainly the problems
aren't as glaring.

More information about the Libraries mailing list