]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/lib/cps.ml
improved type hierarchy management
[helm.git] / helm / software / lambda-delta / lib / cps.ml
index 14b9d4a2c67c361938344372e7f32aa6de01b258..2e8b2c7155715c14d106bad53edd72bb21c11e0a 100644 (file)
@@ -30,6 +30,13 @@ let rec list_rev_map_append f map ~tail = function
          let f hd = list_rev_map_append f map ~tail:(hd :: tail) tl in
          map f hd
 
+let rec forall2 f map l1 l2 = match l1, l2 with
+   | [], []                 -> f true
+   | hd1 :: tl1, hd2 :: tl2 ->
+      let f b = if b then forall2 f map tl1 tl2 else f false in
+      map f hd1 hd2
+   | _                      -> f false
+
 let list_rev_append f =
    list_rev_map_append f (fun f t -> f t)
 
@@ -42,3 +49,6 @@ let list_rev =
 let list_map f =
    list_rev_map (list_rev f)
    
+let list_iter f map l =
+   let map f () x = map f x in
+   list_fold_left f map () l