[m-users.] How to specify the mode of a higher order predicate

Mark Brown mark at mercurylang.org
Sat Jul 11 10:12:11 AEST 2015


On Sat, Jul 11, 2015 at 7:56 AM, Dirk Ziegemeyer <dirk at ziegemeyer.de> wrote:
> I could not find the valid syntax yet for telling mercury the mode of list.append without wrapping it into a new predicate.
>
> Is this possible?

If you use a write is as a pred expression then that will supply the info:

    Append = (pred(X::in, Y::in, Z::out) is det :- append(X, Y, Z),
    aggregate(test2(ID), Append, [], List)

Cheers,
Mark.



More information about the users mailing list