package core
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=bcac85c0ec5795ccabf1dccf0968ecd9
sha512=2e68556773549e0bf302c8733c9fc57df3c0fd73a1b547dc17097f74c5b5482c816ef89853b437e49452da7c124ef32a8a0de0dff64d71145b2ab11befbe5bb2
doc/core/Core/Option_array/index.html
Module Core.Option_arraySource
This module extends Base.Option_array with bin_io.
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
include module type of struct include Base.Option_array end
with type 'a t := 'a t
include Base.Indexed_container.Generic
with type ('a, _) t := 'a t
and type 'a elt := 'a option
include Base.Container.Generic
with type ('a, _) t := 'a t
with type 'a elt := 'a option
val fold_result :
'a t ->
init:'acc ->
f:('acc -> 'a option -> ('acc, 'e) Base.Result.t) ->
('acc, 'e) Base.Result.tval fold_until :
'a t ->
init:'acc ->
f:('acc -> 'a option -> ('acc, 'final) Base.Container.Continue_or_stop.t) ->
finish:('acc -> 'final) ->
'finalval sum :
(module Base.Container.Summable with type t = 'sum) ->
'a t ->
f:('a option -> 'sum) ->
'sumThese are all like their equivalents in Container except that an index starting at 0 is added as the first argument to f.
get t i returns the element number i of array t, raising if i is outside the range 0 to length t - 1.
These can cause arbitrary behavior when used for an out-of-bounds array access.
unsafe_get_some_exn t i is unsafe because it does not bounds check i. It does, however check whether the value at index i is none or some, and raises if it is none.
unsafe_get_some_assuming_some t i is unsafe both because it does not bounds check i and because it does not check whether the value at index i is none or some, assuming that it is some.
set t i x modifies array t in place, replacing element number i with x, raising if i is outside the range 0 to length t - 1.
map f [|a1; ...; an|] applies function f to a1, a2, ..., an, in order, and builds the option_array [|f a1; ...; f an|] with the results returned by f.
map_some t ~f is like map, but None elements always map to None and Some always map to Some.
Unsafe versions of set*. Can cause arbitrary behaviour when used for an out-of-bounds array access.