module Js_vector:sig
..end
type'a
t ='a array
val filterInPlace : ([ `Arity_1 of 'a ], bool) Js.Internal.fn -> 'a t -> unit
p
: predicatea
: arrayval empty : 'a t -> unit
val pushBack : 'a -> 'a t -> unit
val copy : 'a t -> 'a t
val memByRef : 'a -> 'a t -> bool
val iter : ([ `Arity_1 of 'a ], unit) Js.Internal.fn -> 'a t -> unit
val iteri : ([ `Arity_2 of int * 'a ], unit) Js.Internal.fn -> 'a t -> unit
val ofList : 'a list -> 'a t
val toList : 'a t -> 'a list
val map : ([ `Arity_1 of 'a ], 'b) Js.Internal.fn -> 'a t -> 'b t
val mapi : ([ `Arity_2 of int * 'a ], 'b) Js.Internal.fn ->
'a t -> 'b t
val foldLeft : ([ `Arity_2 of 'a * 'b ], 'a) Js.Internal.fn -> 'a -> 'b t -> 'a
val foldRight : ([ `Arity_2 of 'b * 'a ], 'a) Js.Internal.fn -> 'b t -> 'a -> 'a
val length : 'a t -> int
val get : 'a t -> int -> 'a
Array.get a n
returns the element number n
of array a
.
The first element has number 0.
The last element has number Array.length a - 1
.
You can also write a.(n)
instead of Array.get a n
.
Raise Invalid_argument "index out of bounds"
if n
is outside the range 0 to (Array.length a - 1)
.
val set : 'a t -> int -> 'a -> unit
Array.set a n x
modifies array a
in place, replacing
element number n
with x
.
You can also write a.(n) <- x
instead of Array.set a n x
.
Raise Invalid_argument "index out of bounds"
if n
is outside the range 0 to Array.length a - 1
.
val make : int -> 'a -> 'a t
Array.make n x
returns a fresh array of length n
,
initialized with x
.
All the elements of this new array are initially
physically equal to x
(in the sense of the ==
predicate).
Consequently, if x
is mutable, it is shared among all elements
of the array, and modifying x
through one of the array entries
will modify all other entries at the same time.
Raise Invalid_argument
if n < 0
or n > Sys.max_array_length
.
If the value of x
is a floating-point number, then the maximum
size is only Sys.max_array_length / 2
.
val init : int -> ([ `Arity_1 of int ], 'a) Js.Internal.fn -> 'a t
RangeError
when n
is negativen
: sizeval unsafe_get : 'a t -> int -> 'a
val unsafe_set : 'a t -> int -> 'a -> unit