Practical functional programming: pick two
summary
Argues that promises and lists are the same composable container: promise is a container and promise.all turns a list of promises into a promise of a list; shows promises let IO stay parallel while letting code treat results as immutable values. Demonstrates lazy processing with Node streams implemented as map/filter/take and streams as lazy lists (sets highWaterMark to 0 so only needed data is read). Builds an IRC client using pure stream transforms and merge/sampleBy and it works without global state.
AI-written summary · about
chapters (8)
- 0:00Introduction to practical functional programming
- 1:29What FP really means
- 5:53Promises as immutable values
- 9:11Composing promises as containers
- 14:08Laziness in Haskell and JavaScript
- 17:12Streams to functional arrays
- 19:28IRC client in FP
- 25:40Summary
related talks
51mWhat the Functional? What, How and Why
42mBeyond Promises: Async Patterns in JavaScript
43mThe Return of Stream I/O
31mPromises and Generators: control flow utopia
41mFunctional programming: Give it a chance!
30mLearning Functional Programming with JavaScript
40mPromises are much better than you think
43mFirst-Class Programming
