Skip to content

Functional Programming Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 170 companion flashcards using spaced repetition.

8 chapters · 170 cards · Updated

Chapters

  1. 1Foundations of Functional Programming

    Functional programming is a declarative paradigm that treats computation as the evaluation of mathematical functions. Rather than describing step-by-step procedures that mutate sta...

  2. 2Functions and Higher-Order Programming

    Functional programming treats functions as first-class values: they can be assigned to variables, passed as arguments, returned from other functions, and stored in data structures....

  3. 3Data Structures and Types

    Functional programming favors immutable data structures that, when modified, produce new versions while preserving the old. Persistent data structures achieve this efficiently thro...

  4. 4Recursion, Folds, and Evaluation

    Since loops rely on mutable state, functional programming replaces them with recursion, in which a function calls itself on smaller subproblems until it reaches a base case. Deep r...

  5. 5Functors, Applicatives, and Monads

    The functor–applicative–monad hierarchy is a layered abstraction for sequencing computations on wrapped values. A functor is any type that implements a map operation, letting you a...

  6. 6Type System Concepts

    Haskell's type classes provide a mechanism for ad-hoc polymorphism, defining behavior that works across many types. Common examples include \( \text{Eq} \) for equality comparison,...

  7. 7Lambda Calculus and Category Theory

    Lambda calculus, invented by Alonzo Church in the 1930s, is the theoretical foundation of functional programming. It has only three constructs: variables, abstraction \( \lambda x....

  8. 8Real-World Functional Programming and Concurrency

    Different functional languages emphasize different aspects of the paradigm. Haskell is pure and lazy by default, with monadic IO and a powerful type system. OCaml is strict by defa...

← Back to the Functional Programming deck