Functional Programming# Functional Programming A Family of Paradigms Why Is So Much Code Imperative? Three Models of Computation The Practical Tension Road Map Paradigms, Languages, and Types A Few Paradigm-Defining Languages Type Systems The Static–Dynamic Pendulum Why This Leads to Testing Higher-Order Functions map: Transform Every Element filter: Keep the Elements That Qualify reduce: Combine Everything Into One Value accumulate: Keep the Running Results Closures and Composition Functions That Build Functions Fixing Some Arguments: partial Composing Functions Immutable Data and Pure Cores Why Immutability Helps Functional Core, Imperative Shell Worked Examples: Newton and Monte Carlo Newton’s Method as Iteration Monte Carlo π: Imperative vs. Functional Testing for Correctness Layer 1: doctest Layer 2: Example-Based Tests Layer 3: Property-Based Testing Chapter Review Questions Lab: Functional Programming 1. Transform and Filter 2. A Closure 3. Pure Core, Imperative Shell 4. A Property-Based Test 5. Challenge: Functional Newton