Book

Fatih Nayebi
Swift Functional Programming
2 min readMay 2, 2016

7 months ago I started to write a book about Functional programming in Swift.

Yesterday, I finished the review re-writes and submitted it to the Content Editor. The aim of this book is to teach practical functional programming in Swift. I provide lots of examples and developed a TODO application (Backend with Vapor and an iOS application) in last chapter of the book.

Even though, backend part does not include FP paradigms, iOS application combines lots of Functional Programming (FP), Functional Reactive Programming (FRP), Protocol-Oriented Programming (POP) and Object-Oriented Programming (OOP) paradigms.

I will explain these concepts in detail in my upcoming posts!

Description

Functional programming is getting a lot of attention because it eases many of the difficulties faced in object-oriented programming (OOP) such as testability, maintainability, scalability, and concurrency. Swift has a lot of functional programming features that can be easily used, but most Objective-C and Swift programmers are not familiar with these tools.

This book aims to simplify the functional programming paradigms and make it easily usable for Swift programmers, showing you how to use popular functional programming techniques to solve many of your day-to-day development problems. Whether you are new to functional programming and Swift or experienced, this book will provide you with the skills you need to design and develop high-quality, easily maintainable, scalable, and efficient applications for iOS, Mac OS X, tvOS, and WatchOS. Through this book, you’ll learn to build bug-free, maintainable code using functional programming.

We start with functional programming concepts, the basics of Swift, and essential concepts such as functions, closures, optionals, enumerations, and generics in detail with coding examples. Later, we introduce more advanced topics such as functional data structures, monads, functors, and functional design patterns. Finally, we’ll provide a working code example of a real-world application developed with these techniques.

Chapters

  1. Getting started with functional programming in Swift
  2. Functions and closures
  3. Types and type casting
  4. Enumerations and pattern matching
  5. Generics and associated types
  6. Map, Filter and Reduce
  7. Dealing with Optionals
  8. Functional Data Structures
  9. Importance of Immutability
  10. Best of both worlds, combining FP paradigms with OOP
  11. Case Study: Developing an iOS application with FP and OOP paradigms

Book Cover

I took the book’s cover photo at Mosaïcultures Internationales Montréal 2013

Swift 3 Functional Programming

--

--

Fatih Nayebi
Swift Functional Programming

Data Scientist, Author of Swift Functional Programming Book, Lecturer at McGill University