add CCList.cons function

This commit is contained in:
Simon Cruanes 2015-05-25 14:43:08 +02:00
parent 4f4f67fa46
commit e68b951db5
2 changed files with 6 additions and 0 deletions

View file

@ -59,6 +59,8 @@ let (>|=) l f = map f l
let direct_depth_append_ = 10_000
let cons x l = x::l
let append l1 l2 =
let rec direct i l1 l2 = match l1 with
| [] -> l2

View file

@ -41,6 +41,10 @@ val (>|=) : 'a t -> ('a -> 'b) -> 'b t
(** Infix version of [map] with reversed arguments
@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
(** Safe version of append *)