Show, Eq not necessary for Num [Was: Revamping the numeric classes]

Marcin 'Qrczak' Kowalczyk
11 Feb 2001 07:59:38 GMT

Sun, 11 Feb 2001 13:37:28 +1300, Brian Boutel <> pisze:

> Can you demonstrate a revised hierarchy without Eq? What would
> happen to Ord and the numeric classes with default class method
> definitions that use (==) either explicitly or in pattern matching
> against numeric literals?

OK, then you can't write these default method definitions.

I'm against removing Eq from the numeric hierarchy, against making Num
instances for functions, but I would probably remove Show. I haven't
seen a sensible proposal of a replacement of the whole hierarchy.

> In an instance declaration, if a method requires operations of
> another class which is not a superclass of the class being instanced,
> it is sufficient to place the requirement in the context,

Better: it is sufficient if the right instance is defined somewhere.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA