[m-dev.] polymorphic modes

David Overton dmo at hydra.cs.mu.oz.au
Thu Feb 10 00:12:16 AEDT 2000


On Wed, 09 Feb, 2000 at 07:48:01PM EST, Fergus Henderson wrote:
> On 09-Feb-2000, David Overton <dmo at ender.cs.mu.oz.au> wrote:
> > Several weeks ago on the mercury_users list there was a discussion
> > about adding polymorphic modes where the inst parameters were
> > constrained to being ground(shared).
> > 
> > I proposed a syntax something like
> > 
> > 	:- mode p(in(I), out(I)) <= ground(I).
> > 
> > to describe these constrained polymorphic modes.
> 
> How about
> 
> 	:- mode p(in(I), out(I)) <= I is ground.
> 
> ?

Ok, but the main thing I'm worried about, as far as the syntax is
concerned, is how this interacts with typeclass constraints and
determinism declarations which may both appear at the same point as
these inst constraints.  One of these already uses `<=' and the other
already uses `is'.

How do these look:

:- mode p(in(I), out(I)) <= (I is ground) is det.

:- pred p(T::in(I), T::out(I)) <= (fooable(T), I is ground) is det.

?

David
-- 
David Overton       Department of Computer Science & Software Engineering
PhD Student         The University of Melbourne, Australia
+61 3 9344 9159     http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
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