mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-08 12:15:32 -05:00
add CCList.cons function
This commit is contained in:
parent
4f4f67fa46
commit
e68b951db5
2 changed files with 6 additions and 0 deletions
|
|
@ -59,6 +59,8 @@ let (>|=) l f = map f l
|
||||||
|
|
||||||
let direct_depth_append_ = 10_000
|
let direct_depth_append_ = 10_000
|
||||||
|
|
||||||
|
let cons x l = x::l
|
||||||
|
|
||||||
let append l1 l2 =
|
let append l1 l2 =
|
||||||
let rec direct i l1 l2 = match l1 with
|
let rec direct i l1 l2 = match l1 with
|
||||||
| [] -> l2
|
| [] -> l2
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,10 @@ val (>|=) : 'a t -> ('a -> 'b) -> 'b t
|
||||||
(** Infix version of [map] with reversed arguments
|
(** Infix version of [map] with reversed arguments
|
||||||
@since 0.5 *)
|
@since 0.5 *)
|
||||||
|
|
||||||
|
val cons : 'a -> 'a t -> 'a t
|
||||||
|
(** [cons x l] is [x::l]
|
||||||
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
val append : 'a t -> 'a t -> 'a t
|
val append : 'a t -> 'a t -> 'a t
|
||||||
(** Safe version of append *)
|
(** Safe version of append *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue