let partial_map f list = List.flatten (List.map (fun x -> try [f x] with Match_failure _ -> []) list)