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

Michael Day mcda at cat.cs.mu.OZ.AU
Sat Jan 8 01:50:42 AEDT 2000


Hi,

Does the following code make any sense at all:

:- typeclass thing(T) where
	[
		pred is_blue,
		mode is_blue is semidet
	].

:- instance thing(sky) where
	[
		pred(is_blue/1) is semidet_succeed
	].

:- instance thing(sun) where
	[
		pred(is_blue/1) is semidet_fail
	].

...

:- pred both_blue(A, B) <= (thing(A), thing(B)).
:- mode both_blue(in, in) is semidet.

both_blue(A, B) :- ... what can go here? ...

Is there a way to qualify methods by variable name?

Michael

--------------------------------------------------------------------------
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