[m-dev.] feature request: allow `with_type` and `with_inst` in type and inst definitions

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Mar 5 14:31:55 AEDT 2007


On Mon, 5 Mar 2007, Ondrej Bojar wrote:

> Hi,
>
> The `with_type` and `with_inst` annotations are very useful for defining 
> predicates. The constructions work even if I add some extra arguments 
> ("foreseen currying"):
>
> :- pred mypred(myextraarg::in)
>     `with_type` folding_predicate(T)
>     `with_inst` folding_predicate.
>
> where e.g.
>
> :- type folding_predicate(T) == pred(T, T).
> :- inst folding_predicate == (pred(in, out) is det).

That's not particularly surprising; that's how they're supposed to work!

> It would be quite useful to allow the annotations in type and inst 
> definitions, too:
>
> :- type extra_folding_predicate(Extra, T)
>     == (pred(Extra) `with_type` folding_predicate(T)).
> :- inst extra_folding_predicate
>     == (pred(in) `with_inst` folding_predicate).

In principle, I'm not opposed to this idea.

Julien.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list