Reactive computations made simple
Incremental offers a simple API that lets you write computations in a simple, all-at-once way, while getting the performance of a manually optimized, on-line algorithm.
Incremental can help you build:
Large spreadsheet-style calculations that react efficiently to changing data
Views in GUI applications that efficiently incorporate new data
Online versions of existing combinatorial algorithms
Extensive, well-documented API
Incremental’s powerful primitives are exposed in a rich, well-documented API.
Incremental is based on Umcut Acar et al.’s rigorous model of self-adjusting computations.
open! Core_kernel module Incr = Incremental.Incremental.Make () module Incr_map = Incr_map.Make(Incr) (** Given a map of entries with timestamps, incrementally compute a map containing only stale entries. *) let stale_entries entries staleness_delay = let open Incr.Let_syntax in Incr_map.filter_mapi' entries ~f:(fun ~key:_ ~data -> let%bind (entry,time) = data in let when_stale = Time_ns.add time staleness_delay in match%map Incr.at when_stale with | Before -> None | After -> Some entry)
$ opam install incremental
open Core.Std module Inc = Incremental_lib.Incremental.Make ()