(** PROFILING *)
-let profiling_enabled = ref false ;; (* ComponentsConf.profiling *)
+let profiling_enabled = ref true ;; (* ComponentsConf.profiling *)
-let something_profiled = ref false
+let something_profiled = ref false ;;
let _ =
if !something_profiled then
acc, List.rev res
;;
+let filter_map_monad f acc l =
+ let acc, res =
+ List.fold_left
+ (fun (acc, res) t ->
+ match f acc t with
+ | acc, None -> acc, res
+ | acc, Some x -> acc, x::res)
+ (acc,[]) l
+ in
+ acc, List.rev res
+;;
+
let list_rev_map_filter f l =
let rec aux a = function
| [] -> a