let find_opt f l =
    let rec aux = function
      | [] -> None
      | hd :: tl -> if f hd then Some hd else aux tl
    in aux l