[m-rev.] diff: map.foldl2 cc_multi mode
Peter Wang
novalazy at gmail.com
Wed Jul 28 12:10:40 AEST 2010
Branches: main, 10.04
library/map.m:
library/tree234.m:
Add cc_multi modes for map.foldl2 and tree234.foldl2.
NEWS:
Announce the additions.
diff --git a/NEWS b/NEWS
index 6357f78..54d5f84 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ Changes to the Mercury standard library:
* Semidet modes have been added for array.foldl/4, array.foldl2/6,
hash_table.fold/4, version_array.foldl/4, and version_hash_table.fold/4.
+* cc_multi modes have been added for map.foldl2/6, tree234.foldl2/6.
+
* New predicates have been added to the assoc_list module, these are
map_keys_only/3 map_values_only/3 and map_values/3. They complement the
functions of the same name.
diff --git a/library/map.m b/library/map.m
index 754cdc0..d6cdf04 100644
--- a/library/map.m
+++ b/library/map.m
@@ -332,6 +332,14 @@
in, in, out, mdi, muo) is semidet.
:- mode map.foldl2(pred(in, in, in, out, di, uo) is semidet,
in, in, out, di, uo) is semidet.
+:- mode map.foldl2(pred(in, in, in, out, in, out) is cc_multi,
+ in, in, out, in, out) is cc_multi.
+:- mode map.foldl2(pred(in, in, in, out, mdi, muo) is cc_multi,
+ in, in, out, mdi, muo) is cc_multi.
+:- mode map.foldl2(pred(in, in, in, out, di, uo) is cc_multi,
+ in, in, out, di, uo) is cc_multi.
+:- mode map.foldl2(pred(in, in, di, uo, di, uo) is cc_multi,
+ in, di, uo, di, uo) is cc_multi.
% Perform an inorder traversal of the map, applying an accumulator
% predicate with three accumulators for each key-value pair.
diff --git a/library/tree234.m b/library/tree234.m
index 08e3bd6..2dd0a54 100644
--- a/library/tree234.m
+++ b/library/tree234.m
@@ -158,6 +158,14 @@
in, in, out, mdi, muo) is semidet.
:- mode tree234.foldl2(pred(in, in, in, out, di, uo) is semidet,
in, in, out, di, uo) is semidet.
+:- mode tree234.foldl2(pred(in, in, in, out, in, out) is cc_multi,
+ in, in, out, in, out) is cc_multi.
+:- mode tree234.foldl2(pred(in, in, in, out, mdi, muo) is cc_multi,
+ in, in, out, mdi, muo) is cc_multi.
+:- mode tree234.foldl2(pred(in, in, in, out, di, uo) is cc_multi,
+ in, in, out, di, uo) is cc_multi.
+:- mode tree234.foldl2(pred(in, in, di, uo, di, uo) is cc_multi,
+ in, di, uo, di, uo) is cc_multi.
:- pred tree234.foldl3(pred(K, V, A, A, B, B, C, C), tree234(K, V),
A, A, B, B, C, C).
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list