Module Array.Permissioned

type -'perms t
include Core.Bin_prot.Binable.S1__local with type -'perms t := 'perms t
val bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.t
include sig ... end
val bin_size_t : 'a. ('a, 'a t) Bin_prot.Size.sizer1
val bin_write_t : 'a. ('a, 'a t) Bin_prot.Write.writer1
val bin_read_t : 'a. ('a, 'a t) Bin_prot.Read.reader1
val __bin_read_t__ : 'a. ('a, 'a t) Bin_prot.Read.vtag_reader1
val bin_writer_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.writer
val bin_reader_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.reader
val bin_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.t
include Ppx_compare_lib.Comparable.S1 with type -'perms t := 'perms t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
include Ppx_compare_lib.Comparable.S1__local with type -'perms t := 'perms t
val globalize : 'perms. ('perms @ local -> 'perms) -> 'perms t @ local -> 'perms t
include Sexplib0.Sexpable.S1 with type -'perms t := 'perms t
val t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val of_array_id : t -> [< Core.read_write ] t
val to_array_id : [> Core.read_write ] t -> t
val to_sequence_immutable : [> Core.immutable ] t -> elt Core.Sequence.t

to_sequence_immutable t converts t to a sequence. Unlike to_sequence, to_sequence_immutable does not need to copy t since it is immutable.

include Core.Container.S0_permissions with type 'perms t := 'perms t and type elt := elt

Checks whether the provided element is there.

val iter : [> Core.Perms.Export.read ] t -> f:(elt -> Base.Unit.t) @ local -> Base.Unit.t

iter t ~f calls f on each element of t.

val iter_until : [> Core.Perms.Export.read ] t -> f:(elt -> (Base.Unit.t, 'final) Base.Container.Continue_or_stop.t) @ local -> (finish:(Base.Unit.t -> 'final) @ local -> 'final) @ local

iter_until t ~f ~finish is a short-circuiting version of iter. If f returns Stop x the computation ceases and returns x. If f always returns Continue () the final result is computed by finish.

val fold : [> Core.Perms.Export.read ] t -> init:'acc -> f:('acc -> (elt -> 'acc) @ local) @ local -> 'acc

fold t ~init ~f returns f (... f (f (f init e1) e2) e3 ...) en, where e1..en are the elements of t

val fold_result : [> Core.Perms.Export.read ] t -> init:'acc -> f:('acc -> (elt -> ('acc, 'e) Core.Result.t) @ local) @ local -> ('acc, 'e) Core.Result.t

fold_result t ~init ~f is a short-circuiting version of fold that runs in the Result monad. If f returns an Error _, that value is returned without any additional invocations of f.

val fold_until : [> Core.Perms.Export.read ] t -> init:'acc -> f: ('acc -> (elt -> ('acc, 'final) Base.Container.Continue_or_stop.t) @ local) @ local -> (finish:('acc -> 'final) @ local -> 'final) @ local

fold_until t ~init ~f ~finish is a short-circuiting version of fold. If f returns Stop _ the computation ceases and results in that value. If f returns Continue _, the fold will proceed. If f never returns Stop _, the final result is computed by finish.

val exists : [> Core.Perms.Export.read ] t -> f:(elt -> Base.Bool.t) @ local -> Base.Bool.t

Returns true if and only if there exists an element for which the provided function evaluates to true. This is a short-circuiting operation.

val for_all : [> Core.Perms.Export.read ] t -> f:(elt -> Base.Bool.t) @ local -> Base.Bool.t

Returns true if and only if the provided function evaluates to true for all elements. This is a short-circuiting operation.

val count : [> Core.Perms.Export.read ] t -> f:(elt -> Base.Bool.t) @ local -> Base.Int.t

Returns the number of elements for which the provided function evaluates to true.

val sum : (module Base.Container.Summable with type t = 'sum) -> [> Core.Perms.Export.read ] t -> f:(elt -> 'sum) @ local -> 'sum

Returns the sum of f i for i in the container

val find : [> Core.Perms.Export.read ] t -> f:(elt -> Base.Bool.t) @ local -> elt Base.Option.t

Returns as an option the first element for which f evaluates to true.

val find_map : [> Core.Perms.Export.read ] t -> f:(elt -> 'b Base.Option.t) @ local -> 'b Base.Option.t

Returns the first evaluation of f that returns Some, and returns None if there is no such element.

val to_list : [> Core.Perms.Export.read ] t -> elt Base.List.t
val to_array : [> Core.Perms.Export.read ] t -> elt Base.Array.t
val min_elt : [> Core.Perms.Export.read ] t -> compare:(elt -> (elt -> Base.Int.t) @ local) @ local -> elt Base.Option.t

Returns a min (resp max) element from the collection using the provided compare function. In case of a tie, the first element encountered while traversing the collection is returned. The implementation uses fold so it has the same complexity as fold. Returns None iff the collection is empty.

val max_elt : [> Core.Perms.Export.read ] t -> compare:(elt -> (elt -> Base.Int.t) @ local) @ local -> elt Base.Option.t
include Core.Blit.S_permissions with type 'perms t := 'perms t
include Core.Binary_searchable.S0_permissions with type 'perms t := 'perms t and type elt := elt

These functions are in Container.S1_permissions, but they are re-exposed here so that their types can be changed to make them more permissive (see comment above).

val length : _ t @ local -> int
val is_empty : _ t -> bool

counterparts of regular array functions above

val get : [> Core.read ] t @ local -> (int -> elt) @ local
val set : [> Core.write ] t @ local -> (int -> (float @ local -> unit) @ local) @ local
val unsafe_get : [> Core.read ] t @ local -> (int -> elt) @ local
val unsafe_set : [> Core.write ] t @ local -> (int -> (float @ local -> unit) @ local) @ local
val create : len:int -> elt -> [< _ Core.perms ] t
val init : int -> f:(int -> elt) -> [< _ Core.perms ] t
val make_matrix : dimx:int -> dimy:int -> elt -> [< _ Core.perms ] t Core.Array.t
val append : [> Core.read ] t -> [> Core.read ] t -> [< _ Core.perms ] t
val concat : [> Core.read ] t list -> [< _ Core.perms ] t
val copy : [> Core.read ] t -> [< _ Core.perms ] t
val fill : [> Core.write ] t -> pos:int -> len:int -> elt -> unit
val of_list : elt list -> [< _ Core.perms ] t
val map : [> Core.read ] t -> f:(elt -> elt) -> [< _ Core.perms ] t
val mapi : [> Core.read ] t -> f:(int -> elt -> elt) -> [< _ Core.perms ] t
val folding_map : [> Core.read ] t -> init:'a -> f:('a -> elt -> 'a * elt) -> [< _ Core.perms ] t
val iteri : [> Core.read ] t -> f:(int -> elt -> unit) -> unit
val foldi : [> Core.read ] t -> init:'a -> f:(int -> 'a -> elt -> 'a) -> 'a
val folding_mapi : [> Core.read ] t -> init:'a -> f:(int -> 'a -> elt -> 'a * elt) -> [< _ Core.perms ] t
val fold_right : [> Core.read ] t -> f:(elt -> 'a -> 'a) -> init:'a -> 'a
val sort : ?pos:int -> ?len:int -> [> Core.read_write ] t -> compare:(elt -> elt -> int) -> unit
val stable_sort : [> Core.read_write ] t -> compare:(elt -> elt -> int) -> unit
val is_sorted : [> Core.read ] t -> compare:(elt -> elt -> int) -> bool
val is_sorted_strictly : [> Core.read ] t -> compare:(elt -> elt -> int) -> bool
val concat_map : [> Core.read ] t -> f:(elt -> [> Core.read ] t) -> [< _ Core.perms ] t
val concat_mapi : [> Core.read ] t -> f:(int -> elt -> [> Core.read ] t) -> [< _ Core.perms ] t
val partition_tf : [> Core.read ] t -> f:(elt -> bool) -> [< _ Core.perms ] t * [< _ Core.perms ] t
val partitioni_tf : [> Core.read ] t -> f:(int -> elt -> bool) -> [< _ Core.perms ] t * [< _ Core.perms ] t
val cartesian_product : [> Core.read ] t -> [> Core.read ] t -> (elt * elt) Core.Array.t
val transpose : [> Core.read ] t Core.Array.t -> [< _ Core.perms ] t Core.Array.t option
val transpose_exn : [> Core.read ] t Core.Array.t -> [< _ Core.perms ] t Core.Array.t
val filter_opt : elt option Core.Array.t -> [< _ Core.perms ] t
val filter_map : [> Core.read ] t -> f:(elt -> elt option) -> [< _ Core.perms ] t
val filter_mapi : [> Core.read ] t -> f:(int -> elt -> elt option) -> [< _ Core.perms ] t
val for_alli : [> Core.read ] t -> f:(int -> elt -> bool) -> bool
val existsi : [> Core.read ] t -> f:(int -> elt -> bool) -> bool
val counti : [> Core.read ] t -> f:(int -> elt -> bool) -> int
val iter2_exn : [> Core.read ] t -> [> Core.read ] t -> f:(elt -> elt -> unit) -> unit
val map2_exn : [> Core.read ] t -> [> Core.read ] t -> f:(elt -> elt -> elt) -> [< _ Core.perms ] t
val fold2_exn : [> Core.read ] t -> [> Core.read ] t -> init:'c -> f:('c -> elt -> elt -> 'c) -> 'c
val for_all2_exn : [> Core.read ] t -> [> Core.read ] t -> f:(elt -> elt -> bool) -> bool
val exists2_exn : [> Core.read ] t -> [> Core.read ] t -> f:(elt -> elt -> bool) -> bool
val filter : [> Core.read ] t -> f:(elt -> bool) -> [< _ Core.perms ] t
val filteri : [> Core.read ] t -> f:(int -> elt -> bool) -> [< _ Core.perms ] t
val swap : [> Core.read_write ] t -> int -> int -> unit
val rev_inplace : [> Core.read_write ] t -> unit
val of_list_rev : elt list -> [< _ Core.perms ] t
val of_list_map : elt list -> f:(elt -> elt) -> [< _ Core.perms ] t
val of_list_mapi : elt list -> f:(int -> elt -> elt) -> [< _ Core.perms ] t
val of_list_rev_map : elt list -> f:(elt -> elt) -> [< _ Core.perms ] t
val of_list_rev_mapi : elt list -> f:(int -> elt -> elt) -> [< _ Core.perms ] t
val map_inplace : [> Core.read_write ] t -> f:(elt -> elt) -> unit
val find_exn : [> Core.read ] t -> f:(elt -> bool) -> elt
val find_map_exn : [> Core.read ] t -> f:(elt -> 'a option) -> 'a
val findi : [> Core.read ] t -> f:(int -> elt -> bool) -> (int * elt) option
val findi_exn : [> Core.read ] t -> f:(int -> elt -> bool) -> int * elt
val find_mapi : [> Core.read ] t -> f:(int -> elt -> 'a option) -> 'a option
val find_mapi_exn : [> Core.read ] t -> f:(int -> elt -> 'a option) -> 'a
val find_consecutive_duplicate : [> Core.read ] t -> equal:(elt -> elt -> bool) -> (elt * elt) option
val reduce : [> Core.read ] t -> f:(elt -> elt -> elt) -> elt option
val reduce_exn : [> Core.read ] t -> f:(elt -> elt -> elt) -> elt
val permute : ?random_state:Core.Random.State.t -> [> Core.read_write ] t -> unit
val zip : [> Core.read ] t -> [> Core.read ] t -> (elt * elt) Core.Array.t option
val zip_exn : [> Core.read ] t -> [> Core.read ] t -> (elt * elt) Core.Array.t
val unzip : (elt * elt) Core.Array.t -> [< _ Core.perms ] t * [< _ Core.perms ] t
val sorted_copy : [> Core.read ] t -> compare:(elt -> elt -> int) -> [< _ Core.perms ] t
val last : [> Core.read ] t -> elt
val equal : (elt -> elt -> bool) -> [> Core.read ] t -> [> Core.read ] t -> bool
val to_sequence : [> Core.read ] t -> elt Core.Sequence.t
val to_sequence_mutable : [> Core.read ] t -> elt Core.Sequence.t