Session 14: Programming Paradigms & Functional Programming
Overview
The three main paradigms and how they came about, then functional programming in more detail: purity, higher-order functions, and fold as the general list recursion.
Lecturer
Daniel Dia — Primary Instructor & Organizer (dmd13@mail.aub.edu)
Session Information
- Date and Time: Monday 9 November 2026 — 17:30-19:30
- Place: (to be announced)
- Online Meeting Link
- Session Recording
Core Concepts
- Historical exposition (1936-2005): λ-calculus vs Turing machines, the software crisis, structured programming, OOP, Hoare’s null reference (1965), and the concurrency wall (2005)
- Imperative paradigm: state, mutation, sequencing
- OOP paradigm: encapsulation, inheritance, dynamic dispatch
- Functional paradigm: purity, referential transparency, absence of observable side effects
- First-class and higher-order functions;
map,filter,fold, andcomposeas building blocks - Fold as the universal list recursion: deriving
map,filter,length,sum, andreversefrom it - Monoids as the structure
foldrequires - Currying and partial application
- A short demonstration of Lean4 syntax
Slides
Session 14 Slides: Download PDF
Readings
- Why Functional Programming Matters (Hughes)
- Functional Programming in Lean, Ch. 1
- SICP (Abelson & Sussman), Ch. 1
Exercises & Extra Steps
- Practice (not collected): define
mapandfilterin terms offold, then prove yourmapagrees with the direct definition by induction - Practice (not collected): give three examples of monoids and verify the laws
- Practice (not collected): rewrite five imperative loops as
map/filter/foldexpressions - Problem Set 4 due today — hand it in on paper at the start of the session
Navigation
- ← Previous: S13: Recurrences, Master Theorem & Divide-and-Conquer
- Back to Course Overview
- Next: S15: Computability, Decidability & What Hardness Means →
Questions? Reach out on the course WhatsApp!