CCList: remove some functions that are subsumed by the stdlib

This commit is contained in:
Simon Cruanes 2023-11-19 21:56:10 -05:00
parent 3bd95d257c
commit 8c224e42fd
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 1 additions and 19 deletions

View file

@ -1,17 +1,7 @@
(* This file is free software, part of containers. See file "license" for more details. *)
(** {1 Complements to list} *)
(* backport new functions from stdlib here *)
[@@@ocaml.warning "-32"]
let rec find_opt p l =
match l with
| [] -> None
| x :: _ when p x -> Some x
| _ :: tl -> find_opt p tl
let rec compare_lengths l1 l2 =
match l1, l2 with
| [], [] -> 0
@ -57,6 +47,7 @@ let mguard c =
(** max depth for direct recursion *)
let direct_depth_default_ = 1000
(* TRMC on >= 5.1, no need to bring our own *)
[@@@iflt 5.1]
let tail_map f l =
@ -1487,13 +1478,6 @@ let of_seq l =
in
direct direct_depth_default_ l
[@@@else_]
let[@tail_mod_cons] rec of_seq seq =
match seq () with
| Seq.Nil -> []
| Seq.Cons (x, tl) -> x :: of_seq tl
[@@@endif]
let to_gen l =

View file

@ -1,5 +1,3 @@
(* This file is free software, part of containers. See file "license" for more details. *)
(** Complements to List *)
type 'a iter = ('a -> unit) -> unit