+
+let list_iter2 f map l1 l2 =
+ let map f () x1 x2 = map f x1 x2 in
+ list_fold_left2 f map () l1 l2
+
+let rec list_fold_right f map l a = match l with
+ | [] -> f a
+ | hd :: tl -> list_fold_right (map f hd) map tl a
+
+let list_map f map l =
+ let map f hd a =
+ let f hd = f (hd :: a) in map f hd
+ in
+ list_fold_right f map l []
+
+let rec list_mem ?(eq=(=)) a = function
+ | [] -> false
+ | hd :: _ when eq a hd -> true
+ | _ :: tl -> list_mem ~eq a tl