Chapter 6
- Asynchronous computations.
- Try represents the erroneous case as an exception. Exceptions may not always be desirable in a functional context since they make sense only when we want to throw them. Functional programming discourages throwing exceptions since they are side effects. Hence, we have a more general type called Either that is capable of representing an alternative between any two values.
- One way of representing dependency injection in functional programming is via the Reader type. It is an abstraction of the fact that a computation depends on some value and cannot be executed without it. Reader is basically a function. However, it has a more concise signature, and the concept of continuation with flatmap is applied to it the same way as to any other effect type.
- Flatmap allows you to sequentially compose side-effecting computations that use effect types to represent side effects.