Passing state as data in the functional core–imperative shell In an earlier post , we saw that the functional core – imperative shell pattern reduces complexity by centralizing state mutation in the shell, turning hidden state dependencies into explicit ones. The underlying idea is simple: keep state out of the business logic. But putting this into practice is not: how can the business logic still evolve state that lives elsewhere—and why does this make dependencies explicit? Without a clear model at the code level, state easily becomes an implicit dependency again—undermining the whole design. How State Flows Through Core and Shell The functional core – imperative shell pattern separates business logic from side effects. State handling is just another side effect. For state, this means that although the business logic in the core drives changes, it does not persist or mutate state. This is resolved by letting state live in the shell, while the core receives it as input and returns updates.…