let find t ~f = let rec loop = function | [] -> None | x :: l -> if f x then Some x else loop l in loop t