package incr_select

  1. Overview
  2. Docs
Handling of large set of incremental outputs from a single input

Install

dune-project
 Dependency

Authors

Maintainers

Sources

incr_select-v0.12.0.tar.gz
sha256=52848ff15a1636c24b3ad79be99a4324c48341a928bc38cd3bbbd4a1a65c1134
md5=d00eb011ede05fdbf39d23243078531b

doc/incr_select/Incr_select/Make/argument-1-Incr/Update/index.html

Module Incr.Update

on_update t ~f is similar to Observer.on_update_exn, but it does not cause t to be necessary. Instead of the Initialized update, there are updates for when a node becomes Necessary or Unnecessary. Here is a state diagram for the allowable sequences of Update.t's that can be supplied to a particular f:

  /-----------------------------------------------------\
  |                 /                                   |
  |                 |                                   v
 Start ------> Necessary ----------> Changed ------> Invalidated
  |                | ^             |  ^  |              ^
  |                | |   /---------/  \--/              |
  |                v |   v                              |
  \----------> Unnecessary -----------------------------/

If t gets a new value during a stabilization but is unnecessary at the end of it, f will _not_ be called with Changed, but with Unnecessary if allowed by the transition diagram. I.e. if the prior call to f was with Necessary or Changed, f will be called with Unnecessary. If the prior call to f was with Invalidated or Unnecessary, then f will not be called.

One should typically use Observer.on_update_exn, unless the Unnecessary updates are needed.

type 'a t =
  1. | Necessary of 'a
  2. | Changed of 'a * 'a
    (*

    Changed (old_value, new_value)

    *)
  3. | Invalidated
  4. | Unnecessary
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t