[mercury-users] Is "High order predicates" realy high order?

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 22 01:12:08 AEDT 2002


On 21-Nov-2002, Mike Potanin <potanin at mccme.ru> wrote:
> 
> Do Mercury have syntax for pred it return another pred?

Yes.  See the "Higher-order" chapter of the Mercury language reference manual.

> Can I write?
> :-pred pp(pred (pred (X), pred (X))).
> :-mode pp(pred((pred (in) is det), (pred (out) is det)) is det) is det.

To make it parse correctly, you need to delete the space between "pred"
and the immediately following "(":

:- pred pp(pred(pred(X), pred(X))).
:- mode pp(pred((pred(in) is det), (pred(out) is det)) is det) is det.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list