Module Unprime_array.Array

include module type of Stdlib.Array
type 'a t = 'a array
val length : 'a array -> int
val get : 'a array -> int -> 'a
val set : 'a array -> int -> 'a -> unit
val make : int -> 'a -> 'a array
val create : int -> 'a -> 'a array
val create_float : int -> float array
val make_float : int -> float array
val init : int -> (int -> 'a) -> 'a array
val make_matrix : int -> int -> 'a -> 'a array array
val create_matrix : int -> int -> 'a -> 'a array array
val append : 'a array -> 'a array -> 'a array
val concat : 'a array list -> 'a array
val sub : 'a array -> int -> int -> 'a array
val copy : 'a array -> 'a array
val fill : 'a array -> int -> int -> 'a -> unit
val blit : 'a array -> int -> 'a array -> int -> int -> unit
val to_list : 'a array -> 'a list
val of_list : 'a list -> 'a array
val iter : ('a -> unit) -> 'a array -> unit
val iteri : (int -> 'a -> unit) -> 'a array -> unit
val map : ('a -> 'b) -> 'a array -> 'b array
val mapi : (int -> 'a -> 'b) -> 'a array -> 'b array
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b array -> 'a
val fold_right : ('b -> 'a -> 'a) -> 'b array -> 'a -> 'a
val iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit
val map2 : ('a -> 'b -> 'c) -> 'a array -> 'b array -> 'c array
val for_all : ('a -> bool) -> 'a array -> bool
val exists : ('a -> bool) -> 'a array -> bool
val mem : 'a -> 'a array -> bool
val memq : 'a -> 'a array -> bool
val sort : ('a -> 'a -> int) -> 'a array -> unit
val stable_sort : ('a -> 'a -> int) -> 'a array -> unit
val fast_sort : ('a -> 'a -> int) -> 'a array -> unit
val to_seq : 'a array -> 'a Stdlib.Seq.t
val to_seqi : 'a array -> (int * 'a) Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a array
val unsafe_get : 'a array -> int -> 'a
val unsafe_set : 'a array -> int -> 'a -> unit
module Floatarray : sig ... end
include module type of Prime_array
val sample : (int -> 'a) -> int -> 'a array

sample f n returns [|f 0; …; f (n - 1)|]. This calls init with arguments reversed.

val filter : ('a -> bool) -> 'a array -> 'a array

filter f xa is the array containing the elements of xa on which f is true with order preserved.

val fmap : ('a -> 'b option) -> 'a array -> 'b array
val filter_map : ('a -> 'b option) -> 'a array -> 'b array

filter_map f xa is the array of the non-None elements of map f xa, preserving order.

val fold : ('a -> 'b -> 'b) -> 'a array -> 'b -> 'b

fold f [|x₁; …; xₙ|] is f xₙ ∘ ⋯ ∘ f x₁.

val foldi : (int -> 'a -> 'b -> 'b) -> 'a array -> 'b -> 'b

foldi f [|x₁; …; xₙ|] is f (n - 1) xₙ ∘ ⋯ ∘ f 0 x₁.

val for_all : ('a -> bool) -> 'a array -> bool

for_all f [|x₁; …; xₙ|] is true iff f xᵢ is true for all i. f is applied to the elements in order until false is returned.

val exists : ('a -> bool) -> 'a array -> bool

exists f [|x₁; …; xₙ|] is true iff f xᵢ is true for some i. f is applied to the elements in order until true is returned.

val count : ('a -> bool) -> 'a array -> int

count f xa is the number of elements x of xa for which f x holds.

search f xa returns the first element of map f xa which is not None, or None if there is no such element.

val slice : int -> int -> 'a array -> 'a array

slice i j xa returns the subarray from index i inclusive to index j exclusive.