
wren ng thornton [wren@freegeek.org] writes:
On 8/10/11 9:53 AM, Paterson, Ross wrote:
Yet another restructuring of the Prelude numeric classes on algebraic lines, proposed for a revision of the Haskell Prelude:
Very nice in its simplicity, but it suffers from the same problem as all the other attempts I've seen. Namely it ignores the importance of semirings and runs headlong towards fields and beyond. The {(-), abs, signum, negate} methods really must be broken out from (+).
abs and signum are already split off, but it could be further split, with Monoid and Semiring subclasses of AbelianGroup and Ring, and that would fit nicely with a Natural type. I wasn't sure it was worth it (having + operate on lists might be confusing for beginners). But this scheme doesn't preclude doing that later.