In the previous chapter, we saw the views of functional programming on data representation. In functional programming, data is most often encountered in the form of what a function returns. This result is usually a data structure that includes both the results of the function and data about the side effects that have occurred in the function. Different side effects are represented with different data structures.
We also saw how analyzing and working with these data structures can become tedious, so functional programming gives rise to patterns such as map and flatMap. There are many more patterns for working with effect types. The map and flatMap are just utility methods that are used in a specific context. However, they are general enough to repeat from one data type to another.
In this chapter, we will see how functional programming treats the behavior...