Files
mercury/tests/valid/higher_order2.m
Zoltan Somogyi c03b11ca48 Update the style of more test cases.
And updated expected outputs for changed line numbers.
2021-07-27 19:29:21 +10:00

26 lines
625 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
%
% Tests currying of arguments in specialized versions.
:- module higher_order2.
:- interface.
:- import_module list.
:- pred ppp(pred(int, int)::in(pred(in, out) is det), list(int)::in) is det.
:- implementation.
ppp(_, []).
ppp(P, [H0 | T0]) :-
call(P, H0, _H),
ppp(P, T0).
:- pred qqq(list(int)::in, pred(int, int)::pred(in, out) is det) is det.
qqq(L, F) :-
ppp((pred(I::in, O::out) is det :- call(F, I, O)), L).