[mercury-users] variable parameters in typeclass instances

Peter Schachte schachte at cs.mu.OZ.AU
Mon Nov 15 09:24:01 AEDT 1999


On Mon, Nov 15, 1999 at 09:01:16AM +1100, Fergus Henderson wrote:
> > > With what we currently have
> > > 
> > > 	(1) there's a fixed set of type classes and methods
> > > 	    that can be overridden
> > > 
> > > 	(2) the declaration saying that they are overridden
> > > 	    is part of the type, not in a separate instance declaration
> > > 	    (that might occur in a different module)
> 
> Now that I think about it, there is a semantic difference as well.
> With user-defined equality, the program's semantics are determined by
> just _adding_ the axioms for the user-defined equality predicate.
> But with overlapping instances, if there is a specific instance declaration
> then the rules for the general case don't apply; the axioms for a particular
> instance must _override_ those for the general case.

Ok, fair point.

But if we accept restriction (2) above, I would think the semantics
would be clean and simple enough anyway.  No?

-- 
Peter Schachte                     I do not feel obliged to believe that the
mailto:schachte at cs.mu.OZ.AU        same God who has endowed us with sense,
http://www.cs.mu.oz.au/~schachte/  reason, and intellect has intended us to
PGP: finger schachte at 128.250.37.3  forgo their use. -- Galileo Galilei 
--------------------------------------------------------------------------
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