Overview

The h8io.stages.std package holds the stages that stand on their own: they answer to their input, and none of them wraps another stage whose behaviour they alter. Most are built from the immutability hierarchy, so they carry no state between runs unless their whole purpose is to carry some.

Stage What it does
Const ignores its input, always yields the same value
Identity passes its input through unchanged
Swap swaps the two elements of a pair
Coalesce collapses an Either[T, T] to the value either side holds
Complete passes the input through and signals the end of the unit of work
DeadEnd yields nothing, with Status.Complete — the end-of-stream marker
Countdown passes n values through, then completes and resets
GlobalSoftDeadline passes values through until a deadline fixed at construction
Scan folds its own inputs into a running accumulator across runs

The first four never fail and never change: they are Fn stages. Four of them — Identity, Swap, Coalesce and Complete — hold no value at all, so each is a single instance defined over Any and cast to what the use site needs by a typed apply[T], rather than allocated afresh.

The last two carry something between runs. Countdown counts, and Scan accumulates — both by evolving into the next generation of themselves rather than by mutating, and both resetting on any status that is not Success. GlobalSoftDeadline sits between: it never evolves, but the clock it reads moves on its own.