[m-dev.] Ye Olde Subtyping Proposal

Mark Brown dougl at cs.mu.OZ.AU
Mon Nov 18 14:02:10 AEDT 2002

On 18-Nov-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Mark Brown, Saturday, 16 November 2002:
> > 
> > We should also allow a with_inst qualifier to be used if the argument is a
> > pred or func type, otherwise there is no way to specify the determinism,
> > uniqueness of arguments, etc of such a type.  The meaning of a with_inst
> > qualified argument is that the subtype information on the LHS is propagated
> > into the inst on the RHS in the same "obvious" way that the propagation
> > would happen in arguments of pred/func declarations.
> Can you present an example of what you mean and how the expansion would
> work?

See the example on mercury-users.

> I understood your suggestion when we talked about this on Friday,
> but I can't tell from the above whether it's the same idea or not.

It's a different idea, although it's designed to address the same
problem -- that the subtype declarations as proposed didn't include
enough information about higher order insts.

(On Friday I described to Ralph a way of leaving some parts of the
higher order inst undefined, with the condition that the missing
information must be provided by the time the subtype is actually used;
e.g., it could be provided in the mode declaration for a pred/func.
Using with_inst is a better solution, IMHO, but I didn't think of it
until after Friday.)


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