When doing larger Haskell developments involving side-effecting operations, it becomes important how we structure our code. If we are not careful, it can easily become that case that we have IO types everywhere, and that is undesirable. We demonstrate using the example of expert systems / interaction trees that often one can take a data-centric view on a system and define the core logic of a system in such a way that no side effects are involved at all.
A layer that adds the interactive components around the core logic is then one of many possible interpretations of such a system, but other interpretation functions are possible, such as simulations that are useful for testing with low overhead.
Course site with self-test questions: teaching.well-...
20 сен 2024