Module adapton::engine [] [src]

Adapton's core calculus, implemented as a runtime library. We implement two versions of this interface, which we refer to as engines: The naive engine and the DCG engine, implemented based on the algorithms from the Adapton papers.

See also: The main module demonstrates the Adapton programming model with examples.

Modules

manage

Operations that monitor and alter the active engine. Incremental applications should not use these operations directly.

reflect_dcg

Reflects the DCG engine, including both the effects of the programs running in it, and the internal effects of the engine cleaning and dirtying the DCG. For the latter effects, see the trace module.

Structs

Art

Articulations: for incrementally-changing data/computation.

DCG

(DCG) Demanded Computation Graph: The cache of past computation.

Flags

Flags control runtime behavior of the DCG.

Name

Names: First-class data that identifies a mutable cell (see cell) or a thunk (see thunk). When a name identifies different content over time, it describes where incremental changing is occurring, relative to other (unaffected) parts of data structures or computations.

Enums

Engine

The engine API works in two modes: Naive and DCG. A Naive engine is stateless, whereas the DCG is stateful.

NameChoice

A NameChoice chooses between Native, Structural and Nominal identities for articulation points introduced by thunk.

Traits

AbsMapFam

A family of mappings, with a notion of member subsets via abstract mappings. These abstractions compress sequences of observations into a single DCG force edge. See also: force_abs.

Functions

cell

Creates a named reference cell (an eager Art<_>) whose content can change over time.

force

Demands and observes the value of an &Art<T>, returning a (cloned) value of type T.

force_abs

Demand & observe arts, through an abstracted mapping function (See AbsMapFam trait)

force_cycle

Demands and observes the value of an &Art<T>, returning a (cloned) value of type T, or the value of cycle_out if the force edge forms a cycle in the DCG.

force_map

Demands and observes the value of an &Art<T>, returning a (cloned) value of type S, mapped by function mapf.

name_fork

Create two names from one

name_fork3

Create three names from one

name_fork4

Create four names from one

name_of_hash64

Create a name from a hash value.

name_of_isize

Create a name from a isize

name_of_str

Create a name from a str

name_of_string

Create a name from a string

name_of_usize

Create a name from a usize

name_pair

Create one name from two (binary name composition)

name_unit

Create a name from unit, that is, create a "leaf" name.

ns

Creates or re-enters a given namespace; performs the given computation there.

put

Creates an unnamed, immutable reference cell (an eager Art<_>) whose content may not change over time.

set

Mutates a mutable articulation.

structural

Enters a special "namespace" where all name uses are ignored; instead, Adapton uses structural identity.

thunk

Allocates a thunk, an Art<T> that consists of a suspended computation that produces a value of type T.

thunk_map

Map a given thunk by a mapping function map_fn, yielding a new thunk.