~/talk

Monad for dummies

Talkat Dutch PHP Conference 2024 · 2024-03-12..03-15· [functional-programming]
slides:none on file

Explains how monads are implemented in PHP with concrete code: M[T] with unit and bind, a Maybe monad that returns Nothing to short‑circuit a missing product, an Either (left/right) monad that carries typed errors through file → CSV parsing, and a Writer/log monad that threads and concatenates logs across a pipeline. Shows array_map/join for list monads, demos a calculation pipeline (start 3 → add2, square, ×3, ÷6) producing 12.5, and argues this makes testing and centralized error handling easier.

AI-written summary · about

  1. 0:00Introduction
  2. 1:50Functional programming essence
  3. 3:59Pure functions and immutability
  4. 6:44What is a monad
  5. 8:50Maybe monad examples
  6. 13:31Either monad for errors
  7. 20:55Lists as monads in PHP
  8. 24:04Log monad for state
  9. 27:36Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.