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

Dylan Thurston [email protected]
Fri, 9 Feb 2001 11:48:33 -0500

On Thu, Feb 08, 2001 at 08:51:57PM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> > ...
> > class (Show a, Read a, Eq a) => Comfortable a
> > instance (Show a, Read a, Eq a) => Comfortable a 
> ... 
> The latter syntax is nice: obvious what it means, not legal today.
> This instance of course conflicts with any other instance of that
> class, so it can be recognized and treated specially as a "class
> synonym".

Why isn't it legal?  I just tried it, and Hugs accepted it, with or
without extensions.  "where" clauses are optional, right?

> .... Don't know if local instances or local classes can be defined
> to make sense, nor if they could be useful enough...

Well, let's see.  Local classes already exist: just don't export
them.  Local instances would not be hard to add with special syntax,
though really they should be part of a more general mechanism for
dealing with instances explicitly.

Agreed that they might not be useful enough.

	Dylan Thurston