[m-dev.] type classes and the color blue

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jan 11 10:50:20 AEDT 2000


On 10-Jan-2000, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> On 08-Jan-2000, Michael Day <mcda at cat.cs.mu.OZ.AU> wrote:
> > 
> > Does the following code make any sense at all:
> > 
> > :- typeclass thing(T) where
> > 	[
> > 		pred is_blue,
> > 		mode is_blue is semidet
> > 	].

No.  The typeclass methods need to have at least
one argument whose type contains `T'.
Otherwise there is no legal way to invoke them.

> Perhaps the typeclass decl. above should produce a warning.

IMHO it should be an error, not a warning.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list