[mercury-users] discriminated union question

Richard A. O'Keefe ok at atlas.otago.ac.nz
Thu Apr 12 10:10:41 AEST 2001


	:- type pair(T1, T2)
	        --->    T1 - T2.
	
	What is the "-" sign doing here? What does it mean? It doesn't mean subtraction does it?
	
What is it doing?  Just sitting there.  It's a constructor, is all.
	 
What does it mean?  "The thing that ties together a T1 and a T2 to make
a pair(T1,T2)."

Does it mean subtraction?  No.
	
(-)/2 has been the standard pairing operator in Prolog ever since
keysort/2 was added to DEC-10 Prolog >18 years ago.

(And yes, a referee for the new logic programming journal had never heard
of it nor of Mycroft/O'Keefe types either.  Referees, eh?)
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list