forked from ocaml-flambda/flambda-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoubly_linked_list.mli
82 lines (42 loc) · 1.71 KB
/
doubly_linked_list.mli
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
type 'a cell
val insert_and_return_before : 'a cell -> 'a -> 'a cell
val insert_before : 'a cell -> 'a -> unit
val insert_and_return_after : 'a cell -> 'a -> 'a cell
val insert_after : 'a cell -> 'a -> unit
val value : 'a cell -> 'a
val set_value : 'a cell -> 'a -> unit
val prev : 'a cell -> 'a cell option
val next : 'a cell -> 'a cell option
type 'a t
val make_empty : unit -> _ t
val make_single : 'a -> 'a t
val of_list : 'a list -> 'a t
val clear : 'a t -> unit
val hd : 'a t -> 'a option
val hd_cell : 'a t -> 'a cell option
val last : 'a t -> 'a option
val last_cell : 'a t -> 'a cell option
val add_begin : 'a t -> 'a -> unit
val add_end : 'a t -> 'a -> unit
val is_empty : 'a t -> bool
val length : 'a t -> int
val remove_first : 'a t -> f:('a -> bool) -> unit
val delete_before : 'a cell -> unit
val delete_after : 'a cell -> unit
val delete_curr : 'a cell -> unit
val filter_left : 'a t -> f:('a -> bool) -> unit
val filter_right : 'a t -> f:('a -> bool) -> unit
val iter : 'a t -> f:('a -> unit) -> unit
val iteri : 'a t -> f:(int -> 'a -> unit) -> unit
val iter_cell : 'a t -> f:('a cell -> unit) -> unit
val iter_right_cell : 'a t -> f:('a cell -> unit) -> unit
val iter2 : 'a t -> 'a t -> f:('a -> 'a -> unit) -> unit
val fold_left : 'a t -> f:('b -> 'a -> 'b) -> init:'b -> 'b
val fold_right : 'a t -> f:('a -> 'b -> 'b) -> init:'b -> 'b
val find_cell_opt : 'a t -> f:('a -> bool) -> 'a cell option
val find_opt : 'a t -> f:('a -> bool) -> 'a option
val exists : 'a t -> f:('a -> bool) -> bool
val for_all : 'a t -> f:('a -> bool) -> bool
val to_list : 'a t -> 'a list
(* Adds all of the elements of `from` to `to_`, and clears `from`. *)
val transfer : to_:'a t -> from:'a t -> unit -> unit