From 0d35afe57ac42ec0c8b3f7a66a104361a86616b0 Mon Sep 17 00:00:00 2001 From: msozeau Date: Tue, 8 Jun 2010 01:02:59 +0000 Subject: 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 --- lib/util.ml | 7 +++++++ lib/util.mli | 1 + 2 files changed, 8 insertions(+) (limited to 'lib') 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 : -- cgit v1.2.3