mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
CCList: remove some functions that are subsumed by the stdlib
This commit is contained in:
parent
3bd95d257c
commit
8c224e42fd
2 changed files with 1 additions and 19 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue