]> matita.cs.unibo.it Git - helm.git/blobdiff - components/extlib/hExtlib.ml
Same fix of the previous commit, but in a different case.
[helm.git] / components / extlib / hExtlib.ml
index d4572789ad55f39795d000fd09192e839cfee02f..073c5695959480e657070af45a68ec3029132ef6 100644 (file)
@@ -164,6 +164,17 @@ let list_rev_map_filter f l =
    in 
    aux [] l
 
+let list_rev_map_filter_fold f v l =
+   let rec aux v a = function
+      | []       -> v, a
+      | hd :: tl -> 
+         begin match f v hd with
+           | v, None   -> aux v a tl
+           | v, Some b -> aux v (b :: a) tl 
+         end
+   in 
+   aux v [] l
+
 let list_concat ?(sep = []) =
   let rec aux acc =
     function