Logo Mibo

Mibo.Adaptive Namespace

Type/Module Description

AdaptiveContext

The Update-phase context: everything on AdaptiveFrameContext plus the framework-owned intent queue, AdaptiveContext.Intents — intents are unit -> unit work items deferred to a framework-owned moment (after Update, at the top of the next step, or as background work whose completion returns via post).

AdaptiveFixedStepConfig

Fixed-step configuration for an adaptive program — the adaptive counterpart of FixedStepConfig, without the message-mapping slot (there is no 'Msg).

AdaptiveFrameContext

The graph-building context handed to an AdaptiveProgramInit function and to the subscription projection (AdaptiveInit.withSubscriptions).

AdaptiveHeadless<'Frame>

Runs an adaptive program with explicit frame stepping.

AdaptiveInit

Helpers for building an AdaptiveInit.

AdaptiveInit<'Frame>

The result of building an adaptive program's graph.

AdaptiveMonoGameGame<'Frame>

The MonoGame-backed adaptive host. Subclasses Microsoft.Xna.Framework.Game and drives an AdaptiveHeadless runner from Update/Draw.

AdaptiveMonoGameProgram

MonoGame-specific adaptive program builder extensions.

AdaptiveMonoGameProgram<'Frame>

MonoGame-specific wrapper around an AdaptiveProgram, carrying device-level configuration that the backend-neutral type cannot hold.

AdaptiveNode<'T>

AdaptiveProgram

Functions for creating and configuring adaptive programs.

AdaptiveProgram<'Frame>

An adaptive program: the complete description of an adaptive game.

AdaptiveRaylibGame<'Frame>

The raylib-backed host for adaptive programs. Owns the window/audio lifecycle like RaylibGame and delegates the per-frame simulation to an AdaptiveHeadless runner.

AdaptiveReduction

Combinators for building AdaptiveReduction values.

AdaptiveReduction<'a, 's, 'v>

An incremental reduction protocol over elements of type 'a: the state 's is updated with add for added elements and sub for removed ones. sub returns ValueNone when it cannot invert the removal; the library then recomputes the state from the current collection. view projects the state to the observed value.

AdaptiveSub (Module)

Functions for composing AdaptiveSub values.

AdaptiveSub (Type)

A subscription spec: a stable identifier plus an attach function. The adaptive counterpart of Sub: the attach function receives the SubPosting surface instead of Dispatch<'Msg>, so subscription events never run handlers directly — they post work, handled on the owner thread at the next step's boundary, before Update, in order.

AList

Operations on adaptive lists (docs/ALIST-DESIGN.md §4).

alist<'T>

An abbreviation for IAdaptiveList<'T> (FDA alist<'T> parity).

AListSliceExtensions

Slicing for adaptive lists (gap sheet §10.1): list.[a..b]. The bounds are clamped; the slice is the window [a, b] inclusive.

AListToMapNode<'K, 'V>

An adaptive map of a list of entries (FDA AMap.ofAList parity). The list deltas are converted to map deltas: an insert or update sets the key, a remove drops the key. The mirror (key per input position) is aligned with the source; a key update replaces the entry in place.

AMap

Operations on adaptive maps.

amap<'K, 'V>

An abbreviation for IAdaptiveMap<'K,'V> (FDA amap<'K,'V> parity).

AppendListNode<'T>

The concatenation of two lists. Ops from both sources share one journal in arrival order with a source tag: cross-source order matters, because a right op's absolute output position depends on leftCount at its application point (docs/ALIST-DESIGN.md §3.4).

ASet

Operations on adaptive sets.

aset<'T>

An abbreviation for IAdaptiveSet<'T> (FDA aset<'T> parity).

AVal

Core operations for creating and transforming adaptive values. Adaptive values automatically track dependencies and recompute only when their inputs change.

aval<'T>

An abbreviation for IAdaptiveValue<'T> (FDA aval<'T> parity).

BindListNode<'T, 'U>

An adaptive list bound to a scalar value (FDA AList.bind parity): mapping value selects the inner list; when the value or the inner list changes, the output is rebuilt and the positional diff is emitted. The mapping runs only when the value changed. Rebuild-on-change semantics: the deltas are full replaces (the inner list's own deltas are not streamed).

BindMapNode<'K, 'V, 'T>

An adaptive map bound to a scalar value (AMap.bind, PLAN.md Section 7.4): mapping value selects the inner map; when the value changes, the whole inner map is swapped (old content removed, new content added) and the old inner sink is unregistered eagerly (FDA BindReader semantics; ANALYSIS-FDA.md Pitfall 1). The inner map's own changes flow through a journal. Registration is lazy (first read); disposal unregisters everything.

BindSetNode<'T, 'U>

An adaptive set bound to a scalar value (ASet.bind, PLAN.md Section 7.4): mapping value selects the inner set; when the value changes, the whole inner set is swapped (old content removed, new content added) and the old inner sink is unregistered eagerly (FDA BindReader semantics; ANALYSIS-FDA.md Pitfall 1). The inner set's own changes flow through a journal. Registration is lazy (first read); disposal unregisters everything.

ChangeableConverterFactory

The System.Text.Json entry point for changeable nodes. The four changeable node types (cval, cset, cmap, clist) carry a JsonConverter attribute pointing here, so a plain JsonSerializer.Serialize / JsonSerializer.Deserialize call round-trips a node with no options and no converter registration.

ChangeableList<'T>

A changeable list: the writable source of an adaptive list. Reads and writes are confined to the owner thread. See ChangeableSet<'T> for the view, transaction, and disposal contracts.

ChangeableMap<'K, 'V>

A changeable map: the writable source of an adaptive map. Reads and writes are confined to the owner thread. See ChangeableSet<'T> for the transaction and view contracts.

ChangeableSet<'T>

A changeable set: the writable source of an adaptive set. Reads and writes are confined to the owner thread.

ChangeableValue<'T>

Choose2MapNode<'K, 'V1, 'V2, 'V3>

Merges two maps with a mapping over both side values (voptions). The mapping decides the semantics: choose2, intersect(With), union(With) are all this node with different mappings (FDA models them all on Choose2VReader). The mapping is called only when at least one side has a value; the sides' current values are tracked per key.

CList

Operations on changeable lists.

clist<'T>

An abbreviation for ChangeableList<'T> (FDA clist<'T> parity).

CMap

Operations on changeable maps.

cmap<'K, 'V>

An abbreviation for ChangeableMap<'K,'V> (FDA cmap<'K,'V> parity).

CollectSetNode<'T, 'U>

An adaptive set that unions one inner adaptive set per source element (ASet.collect, PLAN.md Section 7.4). The output is the refcounted union of all contributions (the CountingHashSet role): an output element disappears only when the last contributing inner set drops it. A removed source element unregisters its inner sink eagerly (ANALYSIS-FDA.md Pitfall 1). Registration is lazy (first read); disposal unregisters everything.

ConcatListNode<'T>

Concatenates a fixed sequence of lists (FDA AList.concat parity, poll node). Every read re-reads all inner lists (dependency registration); the rebuild and the positional diff run only when any inner list's version moved, so clean reads allocate nothing (library invariant 5).

ConstantList<'T>

A constant list: the content is fixed but computed lazily, once, at first read (FDA parity: the create function runs at most once).

ConstantMap<'K, 'V>

An adaptive map over a fixed, immutable value. The value is computed once, at first read.

ConstantSet<'T>

An adaptive set over a fixed, immutable value. The value is computed once, at first read.

ConstantValue<'T>

CSet

Operations on changeable sets.

cset<'T>

An abbreviation for ChangeableSet<'T> (FDA cset<'T> parity).

CustomListNode<'T>

An adaptive list whose content is driven by a compute function (FDA AList.custom parity, MAPA-DESIGN §1.3). The compute receives the current view and a delta builder; it appends the operations that describe the change since the previous call (consuming its own event queue, for example). Called on every read (poll), like CustomSetNode.

CustomMapNode<'K, 'V>

An adaptive map whose content is driven by a compute function (FDA AMap.custom parity, pull model like CustomSetNode). The compute receives the current view and a delta builder and appends the operations that describe the change since the previous call.

CustomSetNode<'T>

An adaptive set whose content is driven by a compute function. The compute receives the current view and a delta builder; it appends the operations that describe the change since the previous call (consuming its own event queue, for example). Called on every read (poll), like ReaderSetNode. FDA ASet.custom parity, pull model.

CVal

cval<'T>

An abbreviation for ChangeableValue<'T> (FDA cval<'T> parity).

ElementListNode<'T, 'U>

Maps every element of a list to an adaptive value (or chooses/filters, when the aval's value is ValueNone to drop the element).

ElementMapNode<'K, 'V, 'U>

Maps every entry of a map to an adaptive value (or chooses/filters, when the aval's value is ValueNone to drop the entry).

ElementSetNode<'T, 'U>

Maps every element of a set to an adaptive value (or chooses/filters, when the aval's value is ValueNone to drop the element). Duplicate output values share one reference count (refcounted set).

ExternalListNode<'T>

An adaptive list whose content is supplied by an external snapshot function, re-read only when invalidated via the handle returned by AList.ofExternal (FDA AList.ofExternal parity, MAPA-DESIGN §1.1). The re-read is diffed against the previous snapshot positionally (prefix/suffix, the ChangeableList.ApplyDiff algorithm); the diff is delivered as a ListDelta<'T> through the normal delta machinery.

ExternalMapNode<'K, 'V>

An adaptive map whose content is supplied by an external snapshot function, re-read only when invalidated via the handle returned by AMap.ofExternal (FDA AMap.ofExternal parity, MAPA-DESIGN §1.1). The snapshot is materialized into a reused scratch dictionary (the diff helper requires the concrete Dictionary<'K,'V> so its struct enumerator stays allocation-free); the scratch is refilled only on invalidated polls.

ExternalSetNode<'T>

An adaptive set whose content is supplied by an external snapshot function, re-read only when invalidated via the handle returned by ASet.ofExternal (FDA ASet.ofExternal parity, MAPA-DESIGN §1.1). The snapshot is materialized into a reused scratch set (the diff helpers require the concrete HashSet<'T> so their struct enumerators stay allocation-free); the scratch is refilled only on invalidated polls.

FilterMapListNode<'T, 'U>

Maps every element of a list (or chooses/filters, when the mapping returns ValueNone to drop an element).

FilterMapNode<'K, 'V>

Keeps the entries of a map that satisfy a predicate.

FilterSetNode<'T>

Keeps the elements of a set that satisfy a predicate.

GroupByMapNode<'K, 'V, 'G>

Groups the entries of an adaptive map by a computed key (the node behind AMap.groupBy). The output entries are live adaptive maps (GroupMapChildNode<'K,'V>); group-content changes reach the consumers through the children (their deltas and versions), so the output map's version moves only for group add/remove. A group disappears when it becomes empty (removed at the next drain); a key whose value changes group is moved between children.

IAdaptiveList<'T>

An adaptive list: either a changeable source or a derived node. See IAdaptiveSet<'T> for the view and disposal contracts. Positions in list operations are 0-based and refer to the state as of the previous operation in the same delta; deltas are applied in order (docs/ALIST-DESIGN.md §3).

IAdaptiveMap<'K, 'V>

An adaptive map: either a changeable source or a derived node. See IAdaptiveSet<'T> for the view and disposal contracts.

IAdaptiveObject

Base interface for all adaptive objects. Provides version tracking for change detection.

IAdaptiveSet<'T>

An adaptive set: either a changeable source or a derived node.

IAdaptiveValue<'T>

An adaptive value that automatically tracks dependencies and recomputes when inputs change.

ICommit

A unit of deferred work applied at transaction commit.

IntentQueue

The intent queue of an adaptive program: the single place to post unit -> unit work during Update. Intents are work items deferred to a moment the runtime owns, exposed as moment-named entry points: IntentQueue.post (later in this step), IntentQueue.postNextFrame (top of the next step), and IntentQueue.postTask / IntentQueue.postAsync (background work whose completion returns via post). The adaptive counterpart of Cmd — closures capture the handler, so no message type is needed.

JoinMapNode<'K1, 'V1, 'K2, 'V2, 'U>

Per-key equi-join over two adaptive maps (the node behind AMap.joinOn). Every left entry maps to an output entry keyed by the left key; the join key is computed from the left entry and looked up in the right map. The mapping receives the left key, the left value as an adaptive value, and the right-side value (or ValueNone), and returns the output aval; a ValueNone output drops the entry (choose semantics). The per-key subgraph is built once and updated in place: left updates re-apply the value cell (no rebuild), join-key changes re-run the mapping against the new lookup.

LazyConstantValue<'T>

ListCountNode<'T, 'Out>

A count over an adaptive list, projected through view (the node behind AList.count with id and AList.isEmpty with fun c -> c = 0). Registers nothing: the count is re-read at the next read after a write; the version advances only when the projected output changed, so an update (no count change) or a count change that the projection collapses (2 -> 3 under isEmpty) costs this node and its consumers nothing.

ListDelta<'T>

A list delta: ordered operations since the previous delivery. The buffer is transient: valid only during the delivery that received the delta. Order is the semantics: apply the operations sequentially (docs/ALIST-DESIGN.md §3.2).

ListDeltaBuilder<'T>

A class-based delta builder for AList.custom computes. The struct ListDelta<'T> is passed by value (its counter would be copied); this class keeps the appends visible to the node.

ListLastNode<'T>

A last-element lookup over an adaptive list (the node behind AList.tryLast). Registers nothing; the last element is re-read at the next read after a write, and the version advances only when the last element actually changed: an append, a remove of the last element, or an update of the last element. An insert or remove elsewhere shifts positions but leaves the last element untouched, so it bumps nothing. The value is re-read from the source view (O(1)).

ListLookupNode<'T>

A positional lookup over an adaptive list (the node behind AList.tryAt/AList.tryGet/AList.tryFirst). Registers nothing; the position is re-read at the next read after a write, and the version advances only when the element at the watched position actually changed (a shift that lands the same value bumps nothing). The value is re-read from the source view (O(1)).

ListOp<'T>

One list operation. Positions are 0-based and refer to the state as of the previous operation in the same delta; a delta is applied in order.

ListOpKind

The kind of a list operation (docs/ALIST-DESIGN.md §3.1).

ListReduceNode<'a, 'b, 's, 'v>

A reduction over an adaptive list (FDA AList.reduce parity). The reduction state is maintained per delta: an insert adds the mapped value, a remove subtracts it (falling back to a full recompute when the reduction cannot invert, e.g. AdaptiveReduction.fold), an update subtracts the old and adds the new. The mirror is aligned with the input positions, so structural ops shift it with the source. Order-sensitive reductions are the user's contract (the reduction's add/sub must be delta-consistent), the same contract as the set/map reduction nodes.

MapCountNode<'K, 'V, 'Out>

A count over an adaptive map, projected through view (the node behind AMap.count with id and AMap.isEmpty with fun c -> c = 0). Registers nothing: the count is re-read at the next read after a write (O(1) for a materialized source); the version advances only when the projected output changed, so an update of an existing key (no count change) or a count change that the projection collapses (2 -> 3 under isEmpty) costs this node and its consumers nothing.

MapDelta<'K, 'V>

A map delta: upserted entries and removed keys since the previous delivery. The buffers are transient: valid only during the delivery that received the delta.

MapDeltaBuilder<'K, 'V>

A mutable delta builder for AMap.custom computes. See SetDeltaBuilder<'T> for the protocol.

MapLookupNode<'K, 'V>

A per-key lookup over an adaptive map (the node behind AMap.tryFind and AMap.find). Registers nothing; the key's current value is re-read at the next read after a write, and the version advances only when the value at that key actually changed (read-time equality gate). Writes to unrelated keys cost this node and its consumers nothing — and the write itself costs nothing either (no sink registration, no delivery).

MapMapNode<'K, 'V, 'U>

Maps every entry of a map (or chooses, when the mapping returns ValueNone to drop an entry).

MapNNode<'T, 'U>

MapReduceNode<'k, 'a, 'b, 's, 'v>

A delta-driven reduction over a map. Keeps a mirror of the source values so removals and updates can invert (sub receives the old mapped value). The mapping is applied per journal element at drain time.

MapSetNode<'T, 'U>

Maps every element of a set (or chooses, when the mapping returns ValueNone to drop an element). Duplicate outputs share one reference count.

MapToAListNode<'K, 'V>

An adaptive list of a map's entries (FDA AMap.toAList parity, poll node). The order is the map's iteration order, stable while the map does not change; every read rebuilds and emits the positional diff.

MapToSetNode<'K, 'V, 'T>

A set from a map: every entry contributes the selected value (the key for toASet, the value for toASetValues). Equal selections share one reference count: an entry removal drops the output element only when the last contributing entry disappears.

MapUseListNode<'T, 'W>

Maps every element, disposing the mapped value when the element leaves its position (FDA AList.mapUsei parity; the index is the int input position, the positional deviation). The output is 1:1 with the input; a removed or updated element disposes its mapped value. Disposing the node disposes all live mapped values and clears the output.

MapUseMapNode<'K, 'V, 'W>

Maps every entry, disposing the mapped value when its key leaves (FDA AMap.mapUse parity). The mapped values are stable (the mapping runs once per key). Disposing the node disposes all live mapped values and clears the output.

MapUseSetNode<'A, 'B>

Maps every element, disposing the mapped value when its last source occurrence leaves (FDA ASet.mapUse parity). The mapped values are stable (the mapping runs once per source element); the output is a set, so two source elements mapping to one value are refcounted and the value is disposed only when the last occurrence leaves. Disposing the node disposes all live mapped values and clears the output.

OfAvalListNode<'T, 'S>

An adaptive list over an adaptive value of a sequence (FDA AList.ofAVal parity). Every change of the value replaces the whole state and emits the positional diff as the delta. Poll model: the value is re-read on every read; the diff runs only when its version moved.

OfAvalMapNode<'K, 'V, 'S>

An adaptive map over an adaptive value of a sequence of entries. Every change of the value replaces the whole state and emits the diff as the delta (the rebuild boundary, like OfAvalSetNode).

OfAvalSetNode<'T, 'S>

An adaptive set over an adaptive value of a sequence. Every change of the value replaces the whole state and emits the diff as the delta (the value carries no deltas; this node is the rebuild boundary, like FDA ASet.ofAVal).

PollListSourceNode<'T, 'U>

A poll node that rebuilds its output from the source and emits the positional diff (the gap-sheet poll-node strategy for rev, sort, pairwise). The source is re-read on every read. Rebuild-on-every-read is deliberate: the build function may read additional adaptive inputs (the subA/takeA/skipA bounds do), so a source-version gate would be unsound — a change to an external input would be missed. Nodes whose output is a pure function of the source only (e.g. the dedicated SubListNode) use the gated pattern instead, holding invariant 5 on clean reads.

Posting

Applies changes posted from foreign threads.

ReaderSetNode<'T>

An adaptive set over an external reader function. The reader is called on every read (poll); the node diffs the result against its state and emits the diff as the delta. Pull-based: nothing marks this node, so consumers must re-read it (FDA ASet.ofReader has the same pull model).

ReduceNode<'T>

Specialized adaptive node that reduces N dependencies using a binary operation. Optimized for aggregation patterns like sum, product, min, max.

SetContainsNode<'T>

A per-element membership test over an adaptive set (the node behind ASet.contains). Registers nothing; the membership is re-read at the next read after a write, and the version advances only when the watched element's membership actually changed. Writes to unrelated elements cost nobody anything.

SetCountNode<'T, 'Out>

A count over an adaptive set, projected through view (the node behind ASet.count with id and ASet.isEmpty with fun c -> c = 0). Registers nothing: the count is re-read at the next read after a write; the version advances only when the projected output changed, so a count change that the projection collapses (2 -> 3 under isEmpty) costs the node and its consumers nothing.

SetDelta<'T>

A set delta: elements added and removed since the previous delivery. The buffers are transient: valid only during the delivery that received the delta.

SetDeltaBuilder<'T>

A mutable delta builder for ASet.custom computes. The compute receives the current view and this builder, appends the operations that describe the change since the previous call, and returns. The builder is a class: appends mutate the node's pending delta directly (a struct delta passed by value would be copied and lost).

SetReduceNode<'a, 'b, 's, 'v>

A delta-driven reduction over a set. Registers as a delta sink on the source; the journal is applied to the reduction state on read (drain), with a full recompute fallback when sub cannot invert a removal. Implements the scalar protocol: version and dependency snapshot.

SetToListNode<'T>

An adaptive list of a set's elements (FDA AList.ofASet parity, poll node). The order is the set's iteration order, stable while the set does not change. The set is re-read on every read (dependency registration); the rebuild and the positional diff run only when the set's version moved, so clean reads allocate nothing (library invariant 5).

SetToMapKeepAllNode<'K, 'V, 'T>

A map from a set of entries: every key keeps ALL its values in a HashSet (ofASet/ofASetMapped FDA parity). A changed value set emits a fresh HashSet in the delta (reference identity: downstream nodes compare stored values by equality).

SetToMapNode<'K, 'V, 'T>

A map from a set: every element maps to an entry. When multiple elements map to one key, the last value wins (ofASetIgnoreDuplicates); a removal of an entry whose value is not the current one is a no-op (gated). mapSet uses an unconditional removal (a set key appears once).

SortListNode<'T, 'K>

A stable sort node (FDA AList.sortWith parity, poll model). The keys are computed with their input positions (the sortByi mapping contract); the sort is stable by position. The source is re-read on every read (dependency registration); keys, sort and diff run only when the source's version moved, so clean reads allocate nothing and run no user code (library invariant 5). The keyMapping/comparer must be pure functions of the element — external adaptive reads are not tracked.

StepOutcome<'Frame>

One step's worth of simulation produced by AdaptiveHeadless.RunAsync: the game time and the forced frame of the step.

SubListNode<'T>

The window [offset, offset + count) of a list with adaptive bounds (FDA AList.subA parity, poll node). All three dependencies — the source list and the two bound scalars — are re-read on every read (dependency registration); the window and the positional diff run only when any of their versions moved, so clean reads allocate nothing and run no user code (library invariant 5). The build route of PollListSourceNode cannot gate: its closure may read additional adaptive inputs, so this node exists with the extra versions tracked explicitly.

SubPosting

The post surface handed to an AdaptiveSub attach function: SubPosting.Post queues work for the pre-step drain, which runs on the owner thread at the next step's boundary, before Update. Framework subscriptions also queue work for the post drain (after Update, before the frame is forced) through an internal member; that moment is not part of the public contract.

ToSetListNode<'T>

An adaptive set of a list's elements, deduplicated (FDA AList.toASet parity). The list deltas are converted to set deltas with a per-value occurrence count: an element leaves the output only when its last occurrence leaves. The mirror is aligned with the input positions.

Transaction

TwoSetOp

The binary set operation of TwoSourceSetNode<'T>: difference (left minus right), intersection, or symmetric difference.

TwoSourceSetNode<'T>

A binary set operation over two sources: difference (left minus right), intersect, or xor. Per-side reference counts drive the output membership.

UnionSetNode<'T>

The union of two sets. One reference count per element across both sides.

Type something to start searching.