summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <smimram@debian.org>2007-08-18 20:34:57 +0000
committerGravatar Samuel Mimram <smimram@debian.org>2007-08-18 20:34:57 +0000
commit72b9a7df489ea47b3e5470741fd39f6100d31676 (patch)
tree60108a573d2a80d2dd4e3833649890e32427ff8d /lib
parent55ce117e8083477593cf1ff2e51a3641c7973830 (diff)
Imported Upstream version 8.1.pl1+dfsgupstream/8.1.pl1+dfsg
Diffstat (limited to 'lib')
-rw-r--r--lib/util.ml8
-rw-r--r--lib/util.mli3
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 89cfd6fc..bf70acc7 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
-(* $Id: util.ml 9225 2006-10-09 15:59:23Z herbelin $ *)
+(* $Id: util.ml 9766 2007-04-13 13:26:28Z herbelin $ *)
open Pp
@@ -267,6 +267,12 @@ let rec list_remove_first a = function
| b::l -> b::list_remove_first a l
| [] -> raise Not_found
+let list_eq_set l1 l2 =
+ let rec aux l1 = function
+ | [] -> l1 = []
+ | a::l2 -> aux (list_remove_first a l1) l2 in
+ try aux l1 l2 with Not_found -> false
+
let list_for_all2eq f l1 l2 = try List.for_all2 f l1 l2 with Failure _ -> false
let list_map_i f =
diff --git a/lib/util.mli b/lib/util.mli
index b2d8f135..cc44a677 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
-(*i $Id: util.mli 9225 2006-10-09 15:59:23Z herbelin $ i*)
+(*i $Id: util.mli 9766 2007-04-13 13:26:28Z herbelin $ i*)
(*i*)
open Pp
@@ -78,6 +78,7 @@ module Stringmap : Map.S with type key = string
(*s Lists. *)
val list_add_set : 'a -> 'a list -> 'a list
+val list_eq_set : 'a list -> 'a list -> bool
val list_intersect : 'a list -> 'a list -> 'a list
val list_union : 'a list -> 'a list -> 'a list
val list_unionq : 'a list -> 'a list -> 'a list