package incremental
Library for incremental computations
Install
Dune Dependency
Authors
Maintainers
Sources
incremental-v0.15.0.tar.gz
sha256=8dc7e111fe3e52068b60300d72a744a63b40a1df79c67b835b364bdceb321b36
doc/incremental.incremental_step_function/Incremental_step_function/index.html
Module Incremental_step_function
An 'a Step_function.t
is a function from Time_ns.t
to 'a
.
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Core.Invariant.S1 with type 'a t := 'a t
val invariant : 'a Base__.Invariant_intf.inv -> 'a t Base__.Invariant_intf.inv
val init : 'a t -> 'a
val steps : 'a t -> (Core.Time_ns.t * 'a) Core.Sequence.t
val value : 'a t -> at:Core.Time_ns.t -> 'a
val constant : 'a -> 'a t
constant a
is the step function t
with value t ~at = a
for all at
.
val create_exn : init:'a -> steps:(Core.Time_ns.t * 'a) list -> 'a t
create_exn ~init ~steps:[(t_1, v_1); ...; (t_n, vn)]
is the step function t
with value t ~at = init
for at < t_1
, value t ~at = vi
for t_i <= at < t_i+1
. create_exn
raises if the times aren't in nondecreasing order, i.e. if for some i < j
, ti > tj
.
val create_from_sequence :
init:'a ->
steps:(Core.Time_ns.t * 'a) Core.Sequence.t ->
'a t
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>