1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
open! Import0
let hd_exn = Caml.List.hd
let length = Caml.List.length
let rev_append = Caml.List.rev_append
let tl_exn = Caml.List.tl
let unzip = Caml.List.split
let exists t ~f = Caml.List.exists t ~f
let exists2_ok l1 l2 ~f = Caml.List.exists2 l1 l2 ~f
let fold t ~init ~f = Caml.List.fold_left t ~f ~init
let fold2_ok l1 l2 ~init ~f = Caml.List.fold_left2 l1 l2 ~init ~f
let for_all t ~f = Caml.List.for_all t ~f
let for_all2_ok l1 l2 ~f = Caml.List.for_all2 l1 l2 ~f
let iter t ~f = Caml.List.iter t ~f
let iter2_ok l1 l2 ~f = Caml.List.iter2 l1 l2 ~f
let nontail_map t ~f = Caml.List.map t ~f
let nontail_mapi t ~f = Caml.List.mapi t ~f
let partition t ~f = Caml.List.partition t ~f
let rev_map t ~f = Caml.List.rev_map t ~f
let rev_map2_ok l1 l2 ~f = Caml.List.rev_map2 l1 l2 ~f
let sort l ~compare = Caml.List.sort l ~cmp:compare
let stable_sort l ~compare = Caml.List.stable_sort l ~cmp:compare
let rev = function
| ([] | [ _ ]) as res -> res
| x :: y :: rest -> rev_append rest [ y; x ]
;;