This chapter covered a lot of topics; they were an interesting display of how suspending computations can be used in a more creative way. Furthermore, we were able to see how this can impact application development by allowing us to write simpler code that is still concurrent. Let's summarize this chapter's lessons:
- We talked about a different type of suspending function that are suspended when they are not needed.
- Some characteristics of a sequence are: it's stateless, so it resets itself after each invocation; it allows us to retrieve information by index; and it allows us to take a group of values at once.
- Some characteristics of an iterator are: it has a state; it can only be read in one direction, so previous elements cannot be retrieved; and it doesn't allow us to retrieve elements by index.
- Both sequences and iterators can suspend after yielding...