mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
Estimated hours taken: 8
Bug fixes for higher_order.m and unused_args.m
NEWS
Removed the message about bugs in unused_args.m and higher_order.m
compiler/options.m
Re-enabled higher_order and unused_args.
compiler/unused_args.m
Fixed so that this now handles partially instantiated
deconstructions correctly.
compiler/higher_order.m
Two bug fixes:
Specialization of types for specialized versions of predicates.
Fixed handling of curried arguments.
compiler/inlining.m, compiler/type_util.m:
Moved inlining:apply_substitution_to_type_map and
inlining:apply_rec_substitution_to_type_map to type_util.m
for use in the higher_order.m bug fix.
library/varset.m
Added predicate varset__new_vars which returns a list of new
variables.
library/term.m
Added predicates term__apply_variable_renaming(_to_list)
to apply a variable renaming (map(var, var)) to a term
or list of terms.
library/map.m
Added map__det_insert_from_corresponding_lists to insert
multiple key-value pairs into a map.
tests/valid/{Mmake, higher_order2.m, higher_order3.m, unused_args_test2.m}
Tests for the bug fixes.
19 lines
432 B
Mathematica
19 lines
432 B
Mathematica
% Tests currying of arguments in specialized versions.
|
|
|
|
:- module higher_order2.
|
|
|
|
:- import_module list.
|
|
|
|
:- pred ppp(pred(int, int), list(int)).
|
|
:- mode ppp(pred(in, out) is det, in) is det.
|
|
ppp(_, []).
|
|
ppp(P, [H0|T0]) :-
|
|
call(P, H0, H),
|
|
ppp(P, T0).
|
|
|
|
:- pred qqq(list(int), pred(int, int)).
|
|
:- mode qqq(in, pred(in, out) is det) is det.
|
|
qqq(L, F) :-
|
|
ppp(lambda([I::in, O::out] is det, call(F, I, O)), L).
|
|
|