Module BatArray.Cap.Labels


module Labels: sig .. end
Operations on Array with labels.

This module overrides a number of functions of Array by functions in which some arguments require labels. These labels are there to improve readability and safety and to let you change the order of arguments to functions. In every case, the behavior of the function is identical to that of the corresponding function of Array.


val init : int -> f:(int -> 'a) -> ('a, [< `Read | `Write ]) BatArray.Cap.t
val make : int -> init:'a -> ('a, [< `Read | `Write ]) BatArray.Cap.t
val create : int -> init:'a -> ('a, [< `Read | `Write ]) BatArray.Cap.t
val make_matrix : dimx:int ->
dimy:int ->
'a ->
(('a, [< `Read | `Write ]) BatArray.Cap.t, [< `Read | `Write ])
BatArray.Cap.t
val create_matrix : dimx:int ->
dimy:int ->
'a ->
(('a, [< `Read | `Write ]) BatArray.Cap.t, [< `Read | `Write ])
BatArray.Cap.t
val sub : ('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
pos:int -> len:int -> ('a, [< `Read | `Write ]) BatArray.Cap.t
val fill : ('a, [< `Read | `Write > `Write ]) BatArray.Cap.t ->
pos:int -> len:int -> 'a -> unit
val blit : src:('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
src_pos:int ->
dst:('a, [< `Read | `Write > `Write ]) BatArray.Cap.t ->
dst_pos:int -> len:int -> unit
val iter : f:('a -> unit) -> ('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> unit
val map : f:('a -> 'b) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write ]) BatArray.Cap.t
val iteri : f:(int -> 'a -> unit) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> unit
val mapi : f:(int -> 'a -> 'b) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write ]) BatArray.Cap.t
val fold_left : f:('a -> 'b -> 'a) ->
init:'a -> ('b, [< `Read | `Write > `Read ]) BatArray.Cap.t -> 'a
val fold_right : f:('a -> 'b -> 'b) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> init:'b -> 'b
val sort : cmp:('a -> 'a -> int) -> ('a, [ `Read | `Write ]) BatArray.Cap.t -> unit
val stable_sort : cmp:('a -> 'a -> int) -> ('a, [ `Read | `Write ]) BatArray.Cap.t -> unit
val fast_sort : cmp:('a -> 'a -> int) -> ('a, [ `Read | `Write ]) BatArray.Cap.t -> unit
val iter2 : f:('a -> 'b -> unit) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write > `Read ]) BatArray.Cap.t -> unit
val iter2i : f:(int -> 'a -> 'b -> unit) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write > `Read ]) BatArray.Cap.t -> unit
val exists : f:('a -> bool) -> ('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> bool
val for_all : f:('a -> bool) -> ('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> bool
val find : f:('a -> bool) -> ('a, [< `Read | `Write > `Read ]) BatArray.Cap.t -> 'a
val map : f:('a -> 'b) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write ]) BatArray.Cap.t
val mapi : f:(int -> 'a -> 'b) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write ]) BatArray.Cap.t
val filter : f:('a -> bool) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('a, [< `Read | `Write ]) BatArray.Cap.t
val filter_map : f:('a -> 'b option) ->
('a, [< `Read | `Write > `Read ]) BatArray.Cap.t ->
('b, [< `Read | `Write ]) BatArray.Cap.t