Principles of Functional Programming in Scala

Explore Principles of Functional Programming in Scala, including Immutability and Persistent Data Structures in Scala, Pure Functions and Side Effects in Scala: Mastering Functional Programming, and Higher-Order Functions and Function Literals in Scala: Mastering Functional Programming.

This chapter introduces the design habits that make Scala feel meaningfully functional rather than merely syntactically different from Java or other JVM languages. The goal is not to turn every program into pure theory. It is to make state, effects, control flow, and composition easier to reason about.

The pages that follow cover the core building blocks: immutability, pure functions, higher-order functions, typing, pattern matching, recursion, laziness, and the way Scala blends functional and object-oriented styles. Read them as foundations for the later chapters on functional design patterns, effect systems, concurrency, and architecture.

Use this chapter to answer three recurring questions:

  • what should stay immutable and why
  • where should effects and mutation be allowed
  • which Scala features make functional code clearer rather than more abstract

In this section

Revised on Thursday, April 23, 2026