[m-dev.] feature request: allow `with_type` and `with_inst` in type and inst definitions
Mark Brown
mark at csse.unimelb.edu.au
Tue Mar 6 01:54:42 AEDT 2007
On 05-Mar-2007, Ondrej Bojar <bojar at csse.unimelb.edu.au> 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).
>
> 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)).
This isn't using "with type" in the same sense as above. X `with_type` T
means (loosely) that the type of X is T, but that doesn't hold in this case.
Cheers,
Mark.
--------------------------------------------------------------------------
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