[m-dev.] Foreign type compare and unification

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 14 13:32:05 AEST 2002


On 14-May-2002, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Mon, May 13, 2002 at 05:34:12PM +1000, Fergus Henderson wrote:
> > User-defined comparison is still not a complete solution to the problem.
> > You also need user-defined io__print, for example.
> > It would be nicer to devise a solution that doesn't single out
> > comparison, but would work equally well for hashing, printing, etc.
> 
> That would be nice, but I don't think it's practical.

Why not?

> People are going to want to print out terms in fancy ways (eg, sets
> with curley braces, maps as a comma-separated list of Key=>Value
> pairs, etc).  When hashing some types of terms, they may use the fact
> that some information is redundant, and not consider it in computing
> the hash.  However, they may still want to write that redeundant info
> when pickling the term, so it loads quickly.
> 
> I think you really need to let users define these predicates any way
> they like.

I agree with you, and that's precisely why I think that It would be nicer
to devise a solution that doesn't single out unification and comparison
as the only predicates which users can define any way they like, but
to instead devise a solution that would work equally well for hashing,
printing, etc.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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