Control flow can be reified as data instead of disappearing into ordinary function calls. An IO value records whether computation has finished, must perform an effect, or should continue through a result-dependent computation. section 13.3.1
An IO interpreter handles three forms of control flow:
- Return produces a final value without further steps. section 13.3.1
- Suspend delays an effect until interpretation forces its thunk. section 13.3.1
- FlatMap sequences a subcomputation and passes its result to a continuation. section 13.3.1
Repeated output as data
printLine("Still going...").forever builds an infinite nested computation: suspended effects form the head, while FlatMap continuations describe the remaining control flow. Interpretation performs the effects later.



