Functional Swift
222 pages
English
PDF
4.5

Functional Swift

Functional Swift

Author:

Year:

Summary:

Introduction

The book Functional Swift (authors: Chris Eidhof, Florian Kugler, Wouter Swierstra, 2019, 222 pages) is not just another guide to the Swift language. It is a deep dive into the paradigm of functional programming as applied to iOS and macOS development. Unlike many books that only superficially touch on higher-order functions, this work offers a systematic approach: from basic concepts to advanced techniques, such as working with parsers and generative testing.

What the book is about

The book is structured as a sequential introduction to functional thinking. The authors do not simply list Swift's capabilities, but show how to change the approach to program design. The main focus is on composition, data immutability, and pure functions. Each chapter contains practical examples that can be immediately applied in real projects.

Who this book is for

The book is intended for developers already familiar with the basics of Swift and having experience in creating applications. It will be useful for those who want to:

  • Improve code quality and reduce the number of errors;
  • Learn to write more testable and predictable programs;
  • Master functional patterns applicable in everyday development;
  • Understand how to use Swift features such as map, flatMap, filter, and reduce not formally, but meaningfully.

What the reader will learn

After reading the book, the reader will be able to:

  • Apply higher-order functions for processing collections;
  • Build function compositions and use currying;
  • Work with optional values in a functional way;
  • Use monads (e.g., Optional and Result) to manage side effects;
  • Implement simple parsers using combinators;
  • Write generative tests using SwiftCheck;
  • Design application architecture based on immutability and pure functions.

Strengths

The main advantage of the book is its practical focus. Each concept is illustrated with code that can be run and modified. The authors do not delve into abstract theories, but show how the functional approach solves real problems: error handling, working with asynchrony, testing. The chapter on parsers deserves special mention — it is a rare topic for Swift books, but it perfectly demonstrates the power of functional composition.

Another plus is the structure. The book is small (222 pages), but each chapter is self-contained. It can be read sequentially or selectively, referring to the necessary sections.

Who is recommended

I recommend this book to all iOS developers who feel that their code has become too complex and tangled. Functional Swift will help you look at familiar tasks from a new angle. The book will also be useful for those interested in functional programming in general, but who want to see its application in a specific ecosystem (Swift, Xcode, Cocoa Touch).

If you are just starting to learn Swift, it is better to first master the basic syntax and fundamentals of OOP, and then return to this book. It requires a certain level of preparation, but rewards the reader with deep understanding.

Recommendations