Quick Reference – Functional Programming Concepts

Immutability

Everything in functional programming is immutable, which means that it can’t change once it’s created. This rule applies to values of variables as well as to the state stored in data types (objects) and has several important implications.

Instead of variables, we use values (section 2.2.1), which are immutable (3.1). Data structures are immutable too (2.2.2, 3.2), which makes understanding programs easier (1.3.3). Immutability is important for refactoring (11.1) and unit testing (11.2), and it allows us to optimize programs using lazy evaluation (11.3). Immutability also plays an important role when we parallelize code (1.4.3, 14.1.3, 14.3).

Declarative Style

Code is written as ...

Get Real-World Functional Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.