[Haskell-cafe] Num instances for 2-dimensional types

Lennart Augustsson lennart at augustsson.net
Mon Oct 5 10:56:27 EDT 2009

Everyone agrees that the Haskell numeric hierarchy is flawed, but I've
yet to see a good replacement.

On Mon, Oct 5, 2009 at 4:51 PM, Brad Larsen <brad.larsen at gmail.com> wrote:
> On Mon, Oct 5, 2009 at 10:36 AM, Miguel Mitrofanov
> <miguelimo38 at yandex.ru> wrote:
> [...]
>> Of course, it's OK to call anything "numbers" provided that you stated
>> explicitly what exactly you would mean by that. But then you have to drop
>> all kind of stuff mathematicians developed for the usual notion of numbers.
>> In the same way, you shouldn't use the "Num" class for your "numbers".
>> On the other hand, people can (ab)use the "Num" class as they wish, and it's
>> their business until they ask a question about it somewhere outside - which
>> makes the business not only theirs.
> [...]
> The Num class has `negate' as part of its definition.  Natural numbers
> are numbers, but I don't believe there is any sensible definition of
> `negate' for them.
> Haskell 98's numeric hierarchy combines many operations which should
> be separate.  As further evidence, every bit of Haskell I have seen
> that does symbolic manipulation of numeric expressions either leaves
> out instances that would make the syntax more convenient, or else
> defines partial instances because certain class functions have no
> sensible definition for symbolic expressions.
> Sincerely,
> Brad
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list