By introducing an abstract IO type for IO actions or plans, we solve the problem. Evaluating IO actions never executes any side effects. In other words, one can evaluate a plan without putting it into action. Execution instead happens via either making an IO action part of the main entry point to a program, or alternatively, by asking GHCi to execute an IO action for us.
Course site with self-test questions: teaching.well-...
20 сен 2024