Functional Kotlin
350 pages
English
PDF
4.5

Functional Kotlin

Functional Kotlin

Author:

Year:

Summary:

Introduction

The book Functional Kotlin (authors Mario Arias and Rivu Chakraborty, 2018, 350 pages) is a practical guide to applying the functional approach in the Kotlin language. Despite the fact that Kotlin initially supports both object-oriented and functional programming, many developers use only a small part of its capabilities. This book aims to fill this gap and show how to write cleaner, more predictable, and easily testable code.

What the book is about

The authors consistently introduce the reader to the key concepts of functional programming (FP) and demonstrate their implementation in Kotlin. The book covers:

  • FP basics: pure functions, immutability, absence of side effects.
  • Working with higher-order functions, lambda expressions, and anonymous functions.
  • Function composition and currying.
  • Functors, applicative functors, and monads — from theory to practical examples.
  • Working with collections in a functional style (map, filter, fold, flatMap).
  • Error handling without exceptions (Option, Either, Try).
  • Concurrency and asynchrony using functional approaches.
  • Testing functional code.

Who this book is for

The book is intended for developers already familiar with the basics of Kotlin (syntax, classes, basic constructs) but wishing to delve deeper into the functional paradigm. It will be useful both for Java developers transitioning to Kotlin and for those who want to write more reliable and concise code. Some experience in FP (e.g., in Scala or Haskell) will be a plus, but is not required — the authors explain concepts from scratch.

What the reader will learn

  • How to write pure functions and avoid side effects.
  • How to use lambdas and higher-order functions to create flexible abstractions.
  • How to apply function composition to build complex operations from simple ones.
  • How to work with monads (Option, Either, Try) for safe error handling.
  • How to use functional approaches for working with collections and data streams.
  • How to test functional code using property-based testing.
  • How to combine OOP and FP in real projects.

Strengths

One of the main advantages of the book is its practical focus. Each concept is accompanied by Kotlin code that can be immediately run and experimented with. The authors do not just list theoretical concepts but show how they solve real problems: handling null, working with collections, asynchrony. The chapter on monads deserves special mention — it is written accessibly, without excessive mathematical abstraction. The book also contains many examples that can be adapted to your own tasks.

Another plus is the structure. The material goes from simple to complex: from basic functions to advanced concepts like free monads and functional effects. This allows the reader to gradually immerse themselves in the topic without being overloaded.

Who it is recommended for

The book will be useful for:

  • Kotlin developers who want to go beyond OOP and master the functional style.
  • Java programmers migrating to Kotlin and wanting to leverage its strengths.
  • Students and teachers studying functional programming in practice.
  • Anyone who wants to write more reliable, testable, and maintainable code.

If you are already familiar with FP in other languages, the book will help transfer that knowledge to the Kotlin and JVM ecosystem. Beginners in FP should be prepared for some challenging topics (monads, functors), but the authors provide enough examples to master them.

Conclusion: Functional Kotlin is a quality guide that bridges the gap between the theory of functional programming and its practical application in Kotlin. Recommended for anyone seriously

Recommendations