| None -> filter_map f tl
| Some v -> v :: filter_map f tl)
+let list_concat ?(sep = []) =
+ let rec aux acc =
+ function
+ | [] -> []
+ | [ last ] -> List.flatten (List.rev (last :: acc))
+ | hd :: tl -> aux ([sep; hd] @ acc) tl
+ in
+ aux []
+
(** {2 File predicates} *)
let is_dir fname =