[m-dev.] Types with user defined equality.

Ralph Becket rbeck at microsoft.com
Tue May 15 20:02:57 AEST 2001


> From: Fergus Henderson [mailto:fjh at cs.mu.OZ.AU]
> Sent: 15 May 2001 05:38
> 
> Having context-dependent semantics like this would make it harder
> to reason about programs.
> [...]

I agree.  Having thought about it, I reckon the best solution 
is probably to use no-tag types.

> > As it stands, you have to torture your code (or make everything
> > cc_multi) if you pattern match against a d.u. type with user-defined
> > equality, making it far less attractive.
> 
> How about replacing the `promise_only_solution' higher-order predicate
with
> a `promise_only_solution' pragma, or a new builtin goal type.
> Would that solve the problem?

Certainly having that as a pragma makes sense to me.

> There are several modules in the extras distribution that use it,
> in particular trailed_update/var.m, lazy_evaluation/lazy.m, and
> clpr/cfloat.m.

I've just realised why I didn't find them:

$ find . -name *.m | grep "equality"

is wrong and not the same as

$ grep "equality" $(find . -name *.m)

- Ralph
--------------------------------------------------------------------------
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