type 'a t = 'a Base.Option_array.t
include Bin_prot.Binable.S1 with type 'a t := 'a t
val bin_shape_t : Bin_prot.Shape.t -> Bin_prot.Shape.t
val bin_size_t : ('a, 'a t) Bin_prot.Size.sizer1
val bin_write_t : ('a, 'a t) Bin_prot.Write.writer1
val bin_read_t : ('a, 'a t) Bin_prot.Read.reader1
val __bin_read_t__ : ('a, int -> 'a t) Bin_prot.Read.reader1
val bin_writer_t : ('a, 'a t) Bin_prot.Type_class.S1.writer
val bin_reader_t : ('a, 'a t) Bin_prot.Type_class.S1.reader
val bin_t : ('a, 'a t) Bin_prot.Type_class.S1.t
include Ppx_sexp_conv_lib.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include module type of sig ... end with type 'a Option_array.t := 'a t
include module type of Base.Option_array with type 'a t := 'a t
include Base.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val init_some : int -> f:(int -> 'a) -> 'a t
val init : int -> f:(int -> 'a option) -> 'a t
val length : 'a t -> int
val get : 'a t -> int -> 'a option
get t i
returns the element numberi
of arrayt
, raising ifi
is outside the range 0 tolength t - 1
.
val get_some_exn : 'a t -> int -> 'a
Raises if the element number
i
isNone
.
val is_none : 'a t -> int -> bool
is_none t i = Option.is_none (get t i)
val is_some : 'a t -> int -> bool
is_some t i = Option.is_some (get t i)
val unsafe_get : 'a t -> int -> 'a option
val unsafe_get_some_exn : 'a t -> int -> 'a
unsafe_get_some_exn t i
is unsafe because it does not bounds checki
. It does, however check whether the value at indexi
is none or some, and raises if it is none.
val unsafe_get_some_assuming_some : 'a t -> int -> 'a
unsafe_get_some_assuming_some t i
is unsafe both because it does not bounds checki
and because it does not check whether the value at indexi
is none or some, assuming that it is some.
val unsafe_is_some : 'a t -> int -> bool
val set : 'a t -> int -> 'a option -> unit
set t i x
modifies arrayt
in place, replacing element numberi
withx
, raising ifi
is outside the range 0 tolength t - 1
.
val set_some : 'a t -> int -> 'a -> unit
val set_none : 'a t -> int -> unit
val swap : 'a t -> int -> int -> unit
val clear : 'a t -> unit
Replaces all the elements of the array with
None
.
val unsafe_set : 'a t -> int -> 'a option -> unit
val unsafe_set_some : 'a t -> int -> 'a -> unit
val unsafe_set_none : 'a t -> int -> unit
include Base.Blit.S1 with type 'a t := 'a t
val blit : src:'a t -> src_pos:int -> dst:'a t -> dst_pos:int -> len:int -> unit
val blito : src:'a t -> ?src_pos:int -> ?src_len:int -> dst:'a t -> ?dst_pos:int -> unit -> unit
val unsafe_blit : src:'a t -> src_pos:int -> dst:'a t -> dst_pos:int -> len:int -> unit
val sub : 'a t -> pos:int -> len:int -> 'a t
val subo : ?pos:int -> ?len:int -> 'a t -> 'a t