aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormsozeau2010-06-08 01:02:59 +0000
committermsozeau2010-06-08 01:02:59 +0000
commit0d35afe57ac42ec0c8b3f7a66a104361a86616b0 (patch)
treef254918bc70c29ee572c3b2ad0551b8d61ca75c4 /lib
parent6b7191b8828578930b7c58017c8c58fd1890b458 (diff)
Fix treatment of {struct x} annotations in presence of generalized
binders. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13086 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ml7
-rw-r--r--lib/util.mli1
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index af5f2e33c4..42cdc2bf2c 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -800,6 +800,13 @@ let list_cartesians op init ll =
let list_combinations l = list_cartesians (fun x l -> x::l) [] l
+let rec list_combine3 x y z =
+ match x, y, z with
+ | [], [], [] -> []
+ | (x :: xs), (y :: ys), (z :: zs) ->
+ (x, y, z) :: list_combine3 xs ys zs
+ | _, _, _ -> raise (Invalid_argument "list_combine3")
+
(* Keep only those products that do not return None *)
let rec list_cartesian_filter op l1 l2 =
diff --git a/lib/util.mli b/lib/util.mli
index 98d2b6cf9d..43dd439131 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -213,6 +213,7 @@ val list_cartesians : ('a -> 'b -> 'b) -> 'b -> 'a list list -> 'b list
(** list_combinations [[a;b];[c;d]] returns [[a;c];[a;d];[b;c];[b;d]] *)
val list_combinations : 'a list list -> 'a list list
+val list_combine3 : 'a list -> 'b list -> 'c list -> ('a * 'b * 'c) list
(** Keep only those products that do not return None *)
val list_cartesian_filter :