[m-dev.] proposal: user-defined equality predicates

David Glen JEFFERY dgj at cs.mu.oz.au
Fri Jun 27 13:29:20 AEST 1997

> > Hi,
> > 
> > I propose to extend Mercury to support user-defined equality predicates
> > for user-defined types.  The following is a proposed new chapter for the
> > Mercury Language Reference Manual describing this feature.  It is probably
> > a bit short on rationale and examples, but please let me know what you think.
> I'm concerned that it might not smoothly merge in with typeclasses. 
> Does it?

I think it should work fine. The unification pred is passed around in the
dictionary (or for normal polymorphism, in the typeinfo), so we'll always choose
the right unification pred.

There's no need to worry about the code doing deconstruction unifications or
switches since, if you are using typeclasses, you don't know the type of the
variable anyway so you can't look inside it anyway.

Is there another sense in which you are concerned?

love and cuddles,

This .sig deliberately left blank

More information about the developers mailing list