aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormsozeau2008-07-04 14:38:44 +0000
committermsozeau2008-07-04 14:38:44 +0000
commitff03e8dd0de507be82e58ed5e8fd902dfd7caf4b (patch)
treeede6bccf7f4dbcca84e5aca8a374b444527c1686 /lib
parente4b265c5f51fbaf87054d13c036878964a98cfcd (diff)
Fixes in handling of implicit arguments:
- Now [ id : Class foo ] makes id an explicit argument, and [ Class foo ] is equivalent to [ {someid} : Class foo ]. This makes declarations such as "Class Ord [ eq : Eq a ]" have sensible implicit args. - Better handling of {} in class and record declarations, refactorize code for declaring structures and classes. - Fix merging of implicit arguments information on section closing. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11204 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ml6
-rw-r--r--lib/util.mli1
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 14a40e378b..ebade654ef 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -576,6 +576,12 @@ let list_fold_left_i f =
in
it_list_f
+let rec list_fold_left3 f accu l1 l2 l3 =
+ match (l1, l2, l3) with
+ ([], [], []) -> accu
+ | (a1::l1, a2::l2, a3::l3) -> list_fold_left3 f (f accu a1 a2 a3) l1 l2 l3
+ | (_, _, _) -> invalid_arg "list_fold_left3"
+
(* [list_fold_right_and_left f [a1;...;an] hd =
f (f (... (f (f hd
an
diff --git a/lib/util.mli b/lib/util.mli
index 9c0756fc94..7e351e2705 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -132,6 +132,7 @@ val list_fold_right_i : (int -> 'a -> 'b -> 'b) -> int -> 'a list -> 'b -> 'b
val list_fold_left_i : (int -> 'a -> 'b -> 'a) -> int -> 'a -> 'b list -> 'a
val list_fold_right_and_left :
('a -> 'b -> 'b list -> 'a) -> 'b list -> 'a -> 'a
+val list_fold_left3 : ('a -> 'b -> 'c -> 'd -> 'a) -> 'a -> 'b list -> 'c list -> 'd list -> 'a
val list_for_all_i : (int -> 'a -> bool) -> int -> 'a list -> bool
val list_except : 'a -> 'a list -> 'a list
val list_remove : 'a -> 'a list -> 'a list