+let list_iter f map l =
+ let map f () x = map f x in
+ list_fold_left f map () l
+
+let rec list_fold_left2 f map a l1 l2 = match l1, l2 with
+ | [], [] -> f a
+ | hd1 :: tl1, hd2 :: tl2 ->
+ let f a = if a = None then f a else list_fold_left2 f map a tl1 tl2 in
+ map f a hd1 hd2
+ | _ -> f None