Merges N independently-typed input streams t1, t2, ... into a single union t1|t2, tagging each emitted value with the variant of the input it came from. Inputs are alternatives, not co-arriving fields. Inverse of unpack_union.
Typical backends
Build a tagged-sum event channel from two unrelated sources and ship it as JSON for a consumer to route by variant.
Multiplex a fault channel and a normal payload channel, then split them back apart on the consumer side.
Caveats
- I/O contractExactly one variant is emitted per tick, corresponding to whichever input fired; unlike pack_tuple / pack_record the inputs are alternatives, not co-arriving fields.
- Hard constraintInputs must not fire simultaneously on a single tick; concurrent fires resolve non-deterministically.
- I/O contractDownstream must unpack_union or type-branch before reading variant-specific fields.
- Hard constraintThe variant tag is positional; reordering inputs changes which value gets which tag and is a breaking change.