Module Base__Option_array
'a Option_array.t is a compact representation of 'a option array: it avoids allocating heap objects representing Some x, usually representing them with x instead. It uses a special representation for None that's guaranteed to never collide with any representation of Some x.
include Base.Sexpable.S1 with type 'a t := 'a t
val t_of_sexp : (Base.Sexp.t -> 'a) -> Base.Sexp.t -> 'a tval sexp_of_t : ('a -> Base.Sexp.t) -> 'a t -> Base.Sexp.t
val init_some : int -> f:(int -> 'a) -> 'a tval init : int -> f:(int -> 'a option) -> 'a tval length : _ t -> intval get : 'a t -> int -> 'a optionget t ireturns the element numberiof arrayt, raising ifiis outside the range 0 tolength t - 1.
val get_some_exn : 'a t -> int -> 'aRaises if the element number
iisNone.
val is_none : _ t -> int -> boolis_none t i = Option.is_none (get t i)
val is_some : _ t -> int -> boolis_some t i = Option.is_some (get t i)
val unsafe_get : 'a t -> int -> 'a optionval unsafe_get_some_exn : 'a t -> int -> 'aunsafe_get_some_exn t iis unsafe because it does not bounds checki. It does, however check whether the value at indexiis none or some, and raises if it is none.
val unsafe_get_some_assuming_some : 'a t -> int -> 'aunsafe_get_some_assuming_some t iis unsafe both because it does not bounds checkiand because it does not check whether the value at indexiis none or some, assuming that it is some.
val unsafe_is_some : _ t -> int -> boolval set : 'a t -> int -> 'a option -> unitset t i xmodifies arraytin place, replacing element numberiwithx, raising ifiis outside the range 0 tolength t - 1.
val set_some : 'a t -> int -> 'a -> unitval set_none : _ t -> int -> unitval swap : _ t -> int -> int -> unitval clear : _ t -> unitReplaces all the elements of the array with
None.
val unsafe_set : 'a t -> int -> 'a option -> unitval unsafe_set_some : 'a t -> int -> 'a -> unitval unsafe_set_none : _ t -> int -> unit
include Base.Blit.S1 with type 'a t := 'a t
val subo : ?pos:int -> ?len:int -> 'a t -> 'a tval sub : 'a t -> pos:int -> len:int -> 'a tval unsafe_blit : src:'a t -> src_pos:int -> dst:'a t -> dst_pos:int -> len:int -> unitval blito : src:'a t -> ?src_pos:int -> ?src_len:int -> dst:'a t -> ?dst_pos:int -> unit -> unitval blit : src:'a t -> src_pos:int -> dst:'a t -> dst_pos:int -> len:int -> unit