package incremental

  1. Overview
  2. Docs
Library for incremental computations

Install

Dune Dependency

Authors

Maintainers

Sources

incremental-v0.13.0.tar.gz
sha256=9aa54116ccfe92d6fd77c16963ce65e726faf9ac8c4c4c084168a5d0656c3d3a
md5=f2dfbc01ac1a5ddfd1e2d09523d49779

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.

type 'a t
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
include Core_kernel.Invariant.S1 with type 'a t := 'a t
val invariant : ('a -> unit) -> 'a t -> unit
val init : 'a t -> 'a
val value : 'a t -> at:Core_kernel.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_kernel.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_kernel.Time_ns.t * 'a) Core_kernel.Sequence.t -> 'a t
OCaml

Innovation. Community. Security.