module Vector:sig..end
Extensible Arrays
type 'a t
val create : unit -> 'a t
val length : 'a t -> int
val size : 'a t -> intSame as length
val get : 'a t -> int -> 'aRaise Not_found if out-of-bounds.
val set : 'a t -> int -> 'a -> unitRaise Not_found if out-of-bounds.
val add : 'a t -> 'a -> unitElement will be added at index size. After addition, it is at index size-1.
val addi : 'a t -> 'a -> intReturn index of added (last) element.
val clear : 'a t -> unitDo not modify actual capacity.
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val map : ('a -> 'b) -> 'a t -> 'b tResult is shrunk.
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b tResult is shrunk.
val find : 'a t -> ?default:'a -> ?exn:exn -> int -> 'aDefault exception is Not_found.
If a default value is provided, no exception is raised.
val update : 'a t -> ?default:'a -> int -> 'a -> unitSet value at index. If the updated index is greater of equal to the vector size, empty cells are inserted with the default value.
Invalid_argument if the index is negative or when it exceeds the
the vector size but the default value is not provided.val to_array : 'a t -> 'a arrayMakes a copy.
val of_array : 'a array -> 'a tMakes a copy.
val capacity : 'a t -> intLow-level interface. Internal capacity.
val resize : 'a t -> int -> unitLow-level interface. Sets internal capacity. Extra elements are removed.
val shrink : 'a t -> unitLow-level interface. Sets capacity to content.