Skip to main content

Module emit

Module emit 

Source
Expand description

Emit substrate-side quirk-apply.nix skeletons from typed TypedDispatcher reflection. Closes the loop typed Rust enum → typed Nix dispatch arm without the operator hand-writing the mapping table.

Pattern: given a DispatcherEntry (catalog) or any TypedDispatcher impl, produce the Nix helpers = { ... } table skeleton that the substrate’s mk-typed-dispatcher.nix combinator consumes. The skeleton has typed stub bodies ({}) per variant; the operator fills in the apply functions per ecosystem.

See theory/TYPED-ABSORPTION.md §IV.2 — this is the “mechanical absorption” step: adding a new ecosystem becomes “declare the Rust enum, emit the Nix skeleton, fill in helpers.” No dispatch fold reimplementation. No Nix parser gymnastics.

Functions§

to_helpers_skeleton
Render a quirk-apply.nix skeleton for a dispatcher catalog entry. Output is a complete, syntactically-valid Nix file (verified by nix-instantiate --eval --strict) consuming ../shared/mk-typed-dispatcher.nix with one helpers arm per variant kind.