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

Tyson Richard DOWD trd at cs.mu.oz.au
Fri Jun 27 13:34:52 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?

Yes, syntax compatability. Will we end up with 2 syntaxes for similar
things?

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of
     trd at cs.mu.oz.au        #  fur.
http://www.cs.mu.oz.au/~trd #



More information about the developers mailing list