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

Ondrej Bojar bojar at csse.unimelb.edu.au
Mon Mar 5 11:47:27 AEDT 2007


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)).
:- inst extra_folding_predicate
      == (pred(in) `with_inst` folding_predicate).


Thanks, Ondrej.

-- 
Ondrej Bojar (mailto:obo at cuni.cz / bojar at ufal.mff.cuni.cz)
http://www.cuni.cz/~obo
--------------------------------------------------------------------------
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