Skip to main content
FUNCTIONAL-PROGRAMMING5 MIN READ

Walk the side-effect boundary

Place IO at the shell and keep report calculation in a pure core.

Report job A nightly revenue report mixes API calls, retries, currency conversion, refund rules, CSV formatting, and database writes in one 180-line function. If you cannot tell whether a failure is IO or calculation, you cannot debug the report under time pressure. Boundary principle Functional core, effectful shell Keep the business calculation over explicit values. Put clocks, APIs, retries, logging, and persistence at the boundary. Mix it all Fast to write, slow to replay. A saved snapshot can replay the business rule without the network. Do not let IO decide business meaning. Let IO provide values. 01 Fetch 02 Compute…

Read the full lesson

Sign up free — one personalized lesson every day, matched to your role and goals.

Already have an account? Sign in

← Back to library
Contact us