diff --git a/src/extList.ml b/src/extList.ml index a1435ee..021513b 100644 --- a/src/extList.ml +++ b/src/extList.ml @@ -173,8 +173,6 @@ let rec find_map_exn f = function | Some y -> y | None -> find_map_exn f xs -let find_map = find_map_exn - let rec find_map_opt f = function | [] -> None | x :: xs -> @@ -182,6 +180,8 @@ let rec find_map_opt f = function | Some _ as y -> y | None -> find_map_opt f xs +let find_map = find_map_opt + let fold_right_max = 1000 let fold_right f l init = diff --git a/src/extList.mli b/src/extList.mli index 4ff2abb..722c0c1 100644 --- a/src/extList.mli +++ b/src/extList.mli @@ -99,12 +99,11 @@ module List : be renamed to stay compatible with OCaml 4.10. *) - val find_map : ('a -> 'b option) -> 'a list -> 'b -#if OCAML >= 402 - [@@ocaml.deprecated "this function will change type to stay compatible with OCaml 4.10 in next extlib release, use ExtList.find_map_exn instead"] -#endif - val find_map_opt : ('a -> 'b option) -> 'a list -> 'b option + (** same as find_map_exn but returning option *) + + val find_map : ('a -> 'b option) -> 'a list -> 'b option + (** same as find_map_opt *) val split_nth : int -> 'a list -> 'a list * 'a list (** [split_nth n l] returns two lists [l1] and [l2], [l1] containing the