include Core.ArrayThis module extends Base.Array.
Array typeinclude sig ... endval bin_t : 'a Bin_prot.Type_class.t ‑> 'a t Bin_prot.Type_class.tval bin_read_t : 'a Bin_prot.Read.reader ‑> 'a t Bin_prot.Read.readerval __bin_read_t__ : 'a Bin_prot.Read.reader ‑> (Core_kernel__.Import.int ‑> 'a t) Bin_prot.Read.readerval bin_reader_t : 'a Bin_prot.Type_class.reader ‑> 'a t Bin_prot.Type_class.readerval bin_size_t : 'a Bin_prot.Size.sizer ‑> 'a t Bin_prot.Size.sizerval bin_write_t : 'a Bin_prot.Write.writer ‑> 'a t Bin_prot.Write.writerval bin_writer_t : 'a Bin_prot.Type_class.writer ‑> 'a t Bin_prot.Type_class.writerval bin_shape_t : Bin_prot.Shape.t ‑> Bin_prot.Shape.tval typerep_of_t : 'a Typerep_lib.Std.Typerep.t ‑> 'a t Typerep_lib.Std.Typerep.tval typename_of_t : 'a Typerep_lib.Std.Typename.t ‑> 'a t Typerep_lib.Std.Typename.tBase.Arrayinclude module type of sig ... end with type a t := a tval t_of_sexp : (Base.Sexp.t ‑> 'a) ‑> Base.Sexp.t ‑> 'a tval sexp_of_t : ('a ‑> Base.Sexp.t) ‑> 'a t ‑> Base.Sexp.tval binary_search : ('a t, 'a, 'key) Base__.Binary_searchable_intf.binary_searchval binary_search_segmented : ('a t, 'a) Base__.Binary_searchable_intf.binary_search_segmentedval mem : 'a t ‑> 'a ‑> equal:('a ‑> 'a ‑> bool) ‑> boolval length : 'a t ‑> intval is_empty : 'a t ‑> boolval iter : 'a t ‑> f:('a ‑> unit) ‑> unitval fold : 'a t ‑> init:'accum ‑> f:('accum ‑> 'a ‑> 'accum) ‑> 'accumval fold_result : 'a t ‑> init:'accum ‑> f:('accum ‑> 'a ‑> ('accum, 'e) Base.Result.t) ‑> ('accum, 'e) Base.Result.tval fold_until : 'a t ‑> init:'accum ‑> f:('accum ‑> 'a ‑> ('accum, 'final) Base__.Container_intf.Continue_or_stop.t) ‑> finish:('accum ‑> 'final) ‑> 'finalval exists : 'a t ‑> f:('a ‑> bool) ‑> boolval for_all : 'a t ‑> f:('a ‑> bool) ‑> boolval count : 'a t ‑> f:('a ‑> bool) ‑> intval sum : (module Base.Commutative_group.S with type t = 'sum) ‑> 'a t ‑> f:('a ‑> 'sum) ‑> 'sumval find : 'a t ‑> f:('a ‑> bool) ‑> 'a optionval find_map : 'a t ‑> f:('a ‑> 'b option) ‑> 'b optionval to_list : 'a t ‑> 'a listval to_array : 'a t ‑> 'a arrayval min_elt : 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> 'a optionval max_elt : 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> 'a optionval invariant : 'a Base__.Invariant_intf.inv ‑> 'a t Base__.Invariant_intf.invexternal get : 'a t ‑> int ‑> 'a = "%array_safe_get" external set : 'a t ‑> int ‑> 'a ‑> unit = "%array_safe_set" external unsafe_get : 'a t ‑> int ‑> 'a = "%array_unsafe_get" external unsafe_set : 'a t ‑> int ‑> 'a ‑> unit = "%array_unsafe_set" val create : len:int ‑> 'a ‑> 'a tval init : int ‑> f:(int ‑> 'a) ‑> 'a tval fill : 'a t ‑> pos:int ‑> len:int ‑> 'a ‑> unitval blit : ('a t, 'a t) Base__.Blit_intf.blitval blito : ('a t, 'a t) Base__.Blit_intf.blitoval unsafe_blit : ('a t, 'a t) Base__.Blit_intf.blitval sub : ('a t, 'a t) Base__.Blit_intf.subval subo : ('a t, 'a t) Base__.Blit_intf.suboval of_list : 'a list ‑> 'a tval iteri : 'a t ‑> f:(int ‑> 'a ‑> unit) ‑> unitval foldi : 'a t ‑> init:'b ‑> f:(int ‑> 'b ‑> 'a ‑> 'b) ‑> 'bval fold_right : 'a t ‑> f:('a ‑> 'b ‑> 'b) ‑> init:'b ‑> 'bval sort : ?pos:int ‑> ?len:int ‑> 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> unitval stable_sort : 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> unitval is_sorted : 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> boolval is_sorted_strictly : 'a t ‑> compare:('a ‑> 'a ‑> int) ‑> boolval concat_map : 'a t ‑> f:('a ‑> 'b array) ‑> 'b arrayval concat_mapi : 'a t ‑> f:(int ‑> 'a ‑> 'b array) ‑> 'b arrayval for_alli : 'a t ‑> f:(int ‑> 'a ‑> bool) ‑> boolval existsi : 'a t ‑> f:(int ‑> 'a ‑> bool) ‑> boolval counti : 'a t ‑> f:(int ‑> 'a ‑> bool) ‑> intval swap : 'a t ‑> int ‑> int ‑> unitval rev_inplace : 'a t ‑> unitval of_list_rev : 'a list ‑> 'a tval of_list_map : 'a list ‑> f:('a ‑> 'b) ‑> 'b tval of_list_rev_map : 'a list ‑> f:('a ‑> 'b) ‑> 'b tval replace : 'a t ‑> int ‑> f:('a ‑> 'a) ‑> unitval map_inplace : 'a t ‑> f:('a ‑> 'a) ‑> unitval find_exn : 'a t ‑> f:('a ‑> bool) ‑> 'aval find_map_exn : 'a t ‑> f:('a ‑> 'b option) ‑> 'bval findi : 'a t ‑> f:(int ‑> 'a ‑> bool) ‑> (int * 'a) optionval findi_exn : 'a t ‑> f:(int ‑> 'a ‑> bool) ‑> int * 'aval find_mapi : 'a t ‑> f:(int ‑> 'a ‑> 'b option) ‑> 'b optionval find_mapi_exn : 'a t ‑> f:(int ‑> 'a ‑> 'b option) ‑> 'bval find_consecutive_duplicate : 'a t ‑> equal:('a ‑> 'a ‑> bool) ‑> ('a * 'a) optionval reduce : 'a t ‑> f:('a ‑> 'a ‑> 'a) ‑> 'a optionval reduce_exn : 'a t ‑> f:('a ‑> 'a ‑> 'a) ‑> 'aval permute : ?random_state:Base.Random.State.t ‑> 'a t ‑> unitval random_element : ?random_state:Base.Random.State.t ‑> 'a t ‑> 'a optionval random_element_exn : ?random_state:Base.Random.State.t ‑> 'a t ‑> 'aval last : 'a t ‑> 'aval unsafe_truncate : 'a t ‑> len:int ‑> unitval to_sequence : 'a t ‑> 'a Base.Sequence.tval to_sequence_mutable : 'a t ‑> 'a Base.Sequence.tmodule Private = Base__Array.PrivateWe add extensions for Int and Float arrays to make them bin-able, comparable,
sexpable, and blit-able (via Blit.S). Permissioned provides fine-grained access
control for arrays.
Operations supporting "normalized" indexes are also available.
module Int = Core_kernel.Array.Intmodule Float = Core_kernel.Array.Floatval normalize : 'a t ‑> Core_kernel__.Import.int ‑> Core_kernel__.Import.intnormalize array index returns a new index into the array such that if the index is
less than zero, the returned index will "wrap around" -- i.e., array.(normalize array
(-1)) returns the last element of the array.
val slice : 'a t ‑> Core_kernel__.Import.int ‑> Core_kernel__.Import.int ‑> 'a tslice t start stop returns a new array including elements t.(start) through
t.(stop-1), normalized Python-style with the exception that stop = 0 is treated as
stop = length t.
val nset : 'a t ‑> Core_kernel__.Import.int ‑> 'a ‑> Core_kernel__.Import.unitArray modification with normalized index.
module Permissioned = Core_kernel.Array.PermissionedThe Permissioned module gives the ability to restrict permissions on an array, so
you can give a function read-only access to an array, create an immutable array, etc.
include Extended_arrayval random_split : ?random_state:Core.Random.State.t ‑> 'a array ‑> p:float ‑> 'a array * 'a arraymakes a random split & subset of an array; p (the fraction that you want to split) is
constrained to be 0, 1. Note that the length of the first array will be the closest
integer to the fraction you desired, meaning that each element is NOT selected with
probability exactly p.
val random_sub : ?random_state:Core.Random.State.t ‑> 'a array ‑> p:float ‑> 'a array