A Look at the Functional Core and Imperative Shell Pattern
by mario-bittencourt
Business logic belongs in pure functions (functional core) while infrastructure concerns like databases and UIs live in the imperative shell—and the core must never call the shell.