[m-rev.] diff: add set.fold4/10 to the standard library

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Jan 30 17:31:55 AEDT 2006


Estimated hours taken: 0.1
Branches: main

Add set.fold4/10 to the standard library (I've found that
I've needed it while converting the exception analysis to use
the intermodule analysis framework.)

library/set.m:
	Add set.fold4/10.

NEWS:
	Mention the new predicate.

	Merge all of the new predicates in the list module into
	one section.

Julien.

Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.399
diff -u -r1.399 NEWS
--- NEWS	27 Jan 2006 05:51:59 -0000	1.399
+++ NEWS	30 Jan 2006 06:29:09 -0000
@@ -184,12 +184,12 @@

 * We have added an `injection' module, for reversible maps that are injective.

-* We have added list.foldl_corresponding/5, list.foldl2_corresponding/7
-  and list.map2_foldl2/8.
+* We have added list.foldl_corresponding/5, list.foldl2_corresponding/7,
+  list.map2_foldl2/8 and list.det_split_list/4.

 * We have added string.word_wrap/2.

-* We have added list.det_split_list/4.
+* We have added set.fold4/10.

 Changes to the Mercury compiler:

Index: library/set.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/set.m,v
retrieving revision 1.73
diff -u -r1.73 set.m
--- library/set.m	17 Oct 2005 11:35:19 -0000	1.73
+++ library/set.m	30 Jan 2006 06:25:21 -0000
@@ -277,6 +277,15 @@
 :- mode set__fold3(pred(in, in, out, in, out, in, out) is semidet, in,
     in, out, in, out, in, out) is semidet.

+:- pred set__fold4(pred(T, A, A, B, B, C, C, D, D), set(T), A, A, B, B,
+        C, C, D, D).
+:- mode set__fold4(pred(in, in, out, in, out, in, out, in, out) is det, in,
+    in, out, in, out, in, out, in, out) is det.
+:- mode set__fold4(pred(in, in, out, in, out, in, out, di, uo) is det, in,
+    in, out, in, out, in, out, di, uo) is det.
+:- mode set__fold4(pred(in, in, out, in, out, in, out, in, out) is semidet, in,
+    in, out, in, out, in, out, in, out) is semidet.
+
     % set__divide(Pred, Set, TruePart, FalsePart):
     % TruePart consists of those elements of Set for which Pred succeeds;
     % FalsePart consists of those elements of Set for which Pred fails.
@@ -504,6 +513,9 @@
 set__fold3(F, S, !A, !B, !C) :-
     list__foldl3(F, set__to_sorted_list(S), !A, !B, !C).

+set__fold4(F, S, !A, !B, !C, !D) :-
+    list__foldl4(F, set__to_sorted_list(S), !A, !B, !C, !D).
+
 set__divide(P, Set, TruePart, FalsePart) :-
     set_ordlist__divide(P, Set, TruePart, FalsePart).


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list