Enumerations and Pattern Matching

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset