[mercury-users] higher order syntax

Ralph Becket rbeck at microsoft.com
Thu Feb 10 23:43:49 AEDT 2000

The mercury syntax allows us to write `P(...)' and
`F(...)' in place of `call(P, ...)' and `apply(F, ...)'
respectively, provided P/F are *variables*
bound to predicate/function values.

On the other hand, if I have, say

:- func f = (func(T1) = T2).

as crops up in, for instance, the monadic style,
I have to write `apply(f, X)' rather than just

Similarly, if F has type `func(T1) = (func(T2) = T3)'
then I have to write `apply(F(X), Y)'.  Would it be
hard to extend the convenience syntax so that one
could write `F(X)(Y)' instead?  Or, if it makes life
any easier for the parser writers, `(F(X))(Y)' and
`(f)(X)'?  This syntax looks clearer and less mixed up
and, IIRC, it's what the XSB/HiLog people do.


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