package colibri2

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t

Plain and simple imperative and extensible Arrays

val create : int -> 'a t
val size : 'a t -> int
val get : 'a t -> int -> 'a
val get_def : 'a t -> int -> 'a -> 'a
val set : 'a t -> int -> 'a -> unit
val is_uninitialized : 'a t -> int -> bool
val uninitialize : 'a t -> int -> unit
val clear : 'a t -> unit

uninitialize all without allocating a new array

val init_inc_size : int -> (int -> 'a) -> 'a t -> unit
val inc_size : int -> 'a t -> unit
val iter_initialized : ('a -> unit) -> 'a t -> unit
val fold_initialized : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val apply_initialized : ('a -> 'a) -> 'a t -> unit
val iter_initializedi : (int -> 'a -> unit) -> 'a t -> unit
val fold_initializedi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a
val copy : 'a t -> 'a t
val move : from:'a t -> to_:'a t -> unit
val push : 'a t -> 'a -> unit

used as a stack, put the element at the end of the array

val drop_last : 'a t -> unit
val decrease_size_to : 'a t -> int -> unit
val get_dumb : 'a t -> int -> 'a

If you know the implementation

val dumb : 'a
OCaml

Innovation. Community. Security.