let fldchs f xs = List.foldBack (fun x xs -> match f x with Some y -> y :: xs | None -> xs) xs []