Summary
In this chapter, we got familiar with optional types. We talked about built-in techniques to deal with Optionals such as optional binding, guard, coalescing, and optional chaining. Then we explored functional programming techniques to deal with Optionals. We created fmap and apply functions and related operators to tackle multiple optional binding problems. Even though some developers may prefer to use built-in multiple optional binding, exploring functional programming techniques practically provides a better understanding of concepts that we will be able to apply to other problems.
Finally, we briefly looked into error handling concepts and how to convert errors to optional values.
In the next chapter, we will explore some examples ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access