package core_kernel
Industrial strength alternative to OCaml's standard library
Install
Dune Dependency
Authors
Maintainers
Sources
core_kernel-v0.16.0.tar.gz
sha256=e37370bad978cfb71fdaf2b1a25ab1506b98ef0b91e0dbd189ffd9d853245ce2
doc/core_kernel.balanced_reducer/Balanced_reducer/index.html
Module Balanced_reducer
Source
A Balanced_reducer.t
stores a mutable fixed-length sequence of optional values, and incrementally maintains the result of folding an associative operation (reduce
) over the sequence as its elements change.
include Base.Invariant.S1 with type 'a t := 'a t
Source
val create_exn :
?sexp_of_a:('a -> Base.Sexp.t) ->
Base.unit ->
len:Base.int ->
reduce:('a -> 'a -> 'a) ->
'a t
create_exn ~len ~reduce
creates a balanced reducer of length len
, all of whose elements are None
. It raises if len < 1
.
set_exn t i a
updates the value at index i
to Some a
. It raises if i
is out of bounds.
get_exn t i
gets the value at index i
. It raises if i
is out of bounds, or set_exn t i
has never been called.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>