Whenever we want to use a value that is not readily available yet – for example, when we
call a function to compute or fetch something over the network –
we can not be sure if things go as were planned.
What if the database connection is down? What if the user typed in an invalid string?
Looping over a collection of items and transforming the individual elements
within is quite a common task. So it seems natural that Scala offers a nice
way to solve this.
Whenever we want to use a value that is not readily available yet – for example, when we
call a function to compute or fetch something over the network –
we can not be sure if things go as were planned.
What if the database connection is down? What if the user typed in an invalid string?