nustack

Atom map

Cheatsheet for the atom kinds. Tables only.

Top-level kinds

KindPurposeExamples
Refaddress atomuser_ref, config["theme"]
Interactionthe work (Query / Command / Action / Flow / Span)Add, Store, Pop, ForEachDo, Retry

Interaction sub-kinds

Mutation is attributed via Ref-child slot annotations on parent atoms. "Contributes" = what an atom of this kind contributes through its own slots; subtree set unions contributions across descendants.

KindContributesYieldsChildren
Queryanyone or N valuesQueries only (may include Actions)
Commandat least one WRITEnothingQueries only (may include Actions)
Actionat least one WRITEone or N valuesQueries only (may include Actions)
Flownonenothing≥1 mutating atom (Command or Action) + Q params
Spanforwards body'sforwards body'sone body (any Nu) + auxiliary Queries

Span is transparent: it wraps any Nu - Ref, Query, Command, Flow, or another Span - and yields what its body yields in the same shape and protocol. The Span atom is always a Span; parents slot-fit it by looking through to the body's yield, not by re-typing.

Query sub-shapes

Sub-shapeYieldsExamples
ScalarQueryone valueLiteral(5), Add, Eq, ref.fetch(), Collect, First
StreamQueryN valuesMap, Filter, Take, ItemsOf, KeysOf, ForEach

Command sub-shapes

Sub-shapeYieldsExamples
ScalarCommandnothingStore, Copy, Append, Delete

(No StreamCommand: Commands yield nothing, so the scalar/stream split doesn't apply.)

Action sub-shapes

Sub-shapeYieldsExamples
ScalarActionone valuePop, Swap, Take, Create
StreamActionN valuesDrain, DeleteReturning, Consume

(Action mirrors Query's scalar/stream split: a single atomic mutate-and-yield, one value or many. A scalar consumer of a StreamAction must reduce it, same as a StreamQuery.)

Flow sub-shapes

Sub-shapeChildrenExamples
Strategymutating atoms (Command or Action) onlySequential (>>), Parallel (|), Race, Gather
Controlmutating atoms + Query paramsIfDo, ForEachDo, WhileDo

Span sub-shapes

Sub-shapeGovernsMechanismExamples
Bracketlifecyclebefore / after / after_failureSnapshot, Transaction
Policyexecutionre-run / fall back on failureRetry, TryCatch

Effects

EffectMeaningObservable?
READmaterialize value from Contextno
WRITEtransform the Contextyes

(Atoms with no effects are pure.)

Ref slot roles

RoleWhat the parent doesEffectExample position
readreads the value at the address(ref, READ)operand
writewrites a value to the address(ref, WRITE)mutation slot

Composition matrix

Rows are parents, columns are children. Cells: ✓ accepted, ✗ rejected.

RefScalarQStreamQScalarCScalarAStreamAStrategyControlBracketPolicy
Ref✓✓✓✗✓✓✗✗✓✓
ScalarQ✓✓✓✗✓✓✗✗✓✓
StreamQ✓✓✓✗✓✓✗✗✓✓
ScalarC✓✓✓✗✓✓✗✗✓✓
ScalarA✓✓✓✗✓✓✗✗✓✓
StreamA✓✓✓✗✓✓✗✗✓✓
Strategy✗✗✗✓✓✓✓✓✓✓
Control✓✓✓✓✓✓✓✓✓✓
Bracket✓✓✓✓✓✓✓✓✓✓
Policy✓✓✓✓✓✓✓✓✓✓

On this page