July 2018
Intermediate to advanced
266 pages
7h 11m
English
The main topic of this chapter is data sources, so we will use a well-known sequence to get an implementation of suspending sequences and iterators: the famous Fibonacci sequence. I am sure that you have already written algorithms to calculate the Fibonacci sequence before, but this may be the first time that you will do so using suspending functions.
If you aren't familiar with it, the Fibonacci sequence is a sequence of numbers in which each number is the result of adding the previous two.
You can see the first eight numbers of the sequence in the following image:

The objective that we have, then, is to write a function ...
Read now
Unlock full access