~/talk

Back to Basics: Functional Programming and Monads in C++

links:none on file
slides:none on file

Argues that real benefit is concrete composition: use std::ranges and views and generators to build lazy pipelines (iota, transform, filter, join, zip, product, chunk_by) that avoid intermediate containers; use std::optional/std::expected with transform/and_then/transform_error to propagate failures without nested ifs; switch to imperative or generators when naive recursion is exponential (Fibonacci); implements a conditional_range to avoid allocations; composes senders/receivers for async work and executes with sync_wait — examples run and the patterns hold.

AI-written summary · about

  1. 0:00Introduction
  2. 0:27Imperative vs declarative
  3. 2:03Functional programming basics
  4. 3:42Functional programming in C++
  5. 5:12Composing algorithms
  6. 7:50Lazy composition with views
  7. 10:43Common range patterns
  8. 11:59Advanced range generation
  9. 16:30Combining multiple ranges
  10. 19:24Chunking and windowing
  11. 23:13Flattening and joining
  12. 25:58Summary of algorithm composition
  13. 29:21Composing optional values
  14. 35:05Optionals and ranges in C++26
  15. 37:15Debugging pipelines
  16. 38:37Handling fallible operations
  17. 44:41Pure functions and I/O
  18. 48:50Parallelizing actions
  19. 50:55Conclusion and monads
~/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.