Model, Update, View. Three pieces, one loop, zero surprises. We explain The Elm Architecture from scratch with side-by-side examples in Rust and Scala, trace where the pattern came from, why it keeps showing up in TUIs and functional codebases, and when it stops being the right tool.
Null references, UI loading spinners that show errors and data simultaneously, payments that are captured and voided at the same time. These are not hypotheticals. They are the direct consequence of types that lie about the domain.
The rat serves the last course. We fix input lag with non-blocking event polling, add the edit feature as a full vertical slice from application layer to TUI, watch the state machine grow from 3 to 4 variants with compiler-guided safety, and close with the key takeaways from the entire migration.
We start a new series by migrating the CLI adapter to a ratatui TUI. We set up the new dependencies, design the module structure under adapters/tui/, model the interaction modes as an enum to make invalid states unrepresentable, and solve the ownership puzzle of cloning a repository in a persistent session.