An effect algebra enumerates primitive operations for a related class of computational effects, such as console, file, or database access. section 13.6
Effect-algebra programs follow a constrained construction and execution pipeline:
- Define an algebra containing the primitive actions that belong together. section 13.6
- Sequence operations with Free, combining several algebras when a program needs multiple effects. section 13.6
- Interpret the resulting free program into a target monad, then run that monad. section 13.6
- Constrain each program to the least effect algebra required, supporting local reasoning and reuse. section 13.6
The design trades operational control for indirection: suspension constructors, union types, and separate interpreters add boilerplate. A capability trait offers a simpler alternative by exposing primitive operations directly in a target monad. section 13.6
