In Chapter 1, Getting Started with Functional Programming in Swift, we were introduced to enumerations briefly. In the previous chapter we got familiar with types and we learned that enums are sum types.
In this chapter, we will cover enumerations and algebraic data types in detail. Also, we will explore patterns and pattern matching in Swift.
This chapter will cover the following topics with coding examples:
- Defining enumerations
- Associated values
- Raw values
- Nesting and containing enumerations
- Using enumerations
- Algebraic data types
- Patterns and pattern matching