[m-dev.] Foreign type compare and unification

Simon Taylor stayl at cs.mu.OZ.AU
Sun May 12 00:28:31 AEST 2002

On 11-May-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 10-May-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > I have been thinking about treating foreign types like the c_pointer type
> > for their RTTI and comparision and unification predicates, ie a foreign type
> > in the compiler will be treated as if it was an equivalence type where the
> > RHS of the equivalence is c_pointer.
> That seems reasonable.
> After all c_pointer is really just the old way of defining foreign types.

That's fine as a default, but it should be possible to declare
the unification and comparison predicates for foreign types.

Is there any reason why we have user-defined equality but not
user-defined comparison? Not having user-defined comparison
makes it difficult to use data types such as cords (strings
represented as trees for constant-time append).

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