How to use T <: CriteriaTag as a hexagonal port so your domain layer never imports a dialect. The database becomes a deployment decision.
How to use T <: CriteriaTag as a hexagonal port so your domain layer never imports a dialect. The database becomes a deployment decision.
Every trait in your hexagonal architecture is a tagless-final algebra. Every impl is an interpreter. You have been writing denotational semantics without knowing it. We trace the connection from Kiselyov’s paper through Scala’s Cats-Effect to Rust’s port traits, and show why the pattern that academics call ‘finally tagless’ is the same pattern that practitioners call ‘dependency injection.’
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.
The rat wires up the ears. We implement mode-specific event handlers with crossterm, redesign the key mapping to use a toggle instead of separate keys, solve the terminal restore problem with a capture-cleanup-return pattern, and run cargo test to discover that zero lines changed outside the adapter.
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.
While revisiting the TaskRepository trait from the Todo CLI series, I realized I was doing more than drawing an architectural boundary. I was also defining what could be said across that boundary, which is much closer to grammar than I first admitted.
We close the series by exploring what it means to migrate from CLI to TUI with ratatui: how the interaction model changes, what frictions Rust introduces with ownership and &mut in a persistent event loop, and why hexagonal architecture absorbs the change without surgery.