If you know map, I will teach you monads
summary
Starts from the concrete claim that map is a capability and demonstrates it across four implementations: array.map, a recursive map_tree function, an async stream implemented with setTimeout and a bacon.Bus, and ES6 promises. Shows a real Google Translate fetch returning Promises via the Google Translate API then flattens them into a stream with bacon.fromPromise, proving map vs flatMap behavior with working examples and printing translated capitalized words (mission success).
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:05Functors and monads
- 2:30Map concept
- 12:15Mapping arrays and trees
- 15:50Streams as functors
- 22:12flatMap and monads
- 27:23Streams and promises as monads
- 32:07Summary
related talks
28mOh Composable World!
36mReact + ES.next = ♥
30mFunctional Programming Fundamentals
19mFrom Imperative to Declarative: Simplifying JavaScript APIs with React.js
21mBetter Async with Redux Saga
07mComonads on your everyday UI
28mHow to use Functional Programming in your React app
50mBuilding with Mapbox GL JS in React
