Skip to main content

Module composed

Module composed 

Source
Expand description

ComposedDispatcher — closure-under-composition for the typed dispatcher catamorphism. Given N sealed dispatchers over disjoint variant universes, produce a single dispatcher that handles any variant from any of them by serde-tag dispatch.

Proves the algebraic law from theory/QUIRK-APPLIER.md §IV-bis.3.d: “the combinator is closed under composition; polyglot caixa packages (Rust+Python+Helm) compose multiple ecosystem appliers in sequence into a unified override stack.”

§Type erasure

The composed view operates on serde_json::Value variants (each carrying a "kind" field). Source dispatchers stay typed (SealedDispatcher<V, C, O>); composition walks the per-kind helpers through a thin adapter that round-trips variants through serde_json. This is the same shape the substrate’s mk-typed-dispatcher.nix consumes (untyped JSON values keyed by kind), so composed Rust dispatchers and composed Nix dispatchers share semantics by construction.

Structs§

ComposedDispatcher
Composition of multiple SealedDispatchers over disjoint variant universes. Operates on serde_json::Value variants keyed by the "kind" field. Use .add(...) to extend.
ComposedSource
One source dispatcher’s contribution to the composition.