let rec find' p lst = match lst with | [] -> None | x :: _ when p x -> Some x | _ :: xs -> find' p xs