Treasure.map(): Functional Programming in Kotlin
summary
Explains why common collection functions map/filter/fold/flatMap are the day-to-day functional tools and makes the concrete claim that lists are monads because they provide flatMap; notes Java/Kotlin lack native monad support but libraries Vavr and Arrow add it and shows Arrow's either and bind for monad comprehensions. Describes error-handling tradeoffs (runCatching hides OOM), reports using Arrow in a fraud-detection service with no major performance drawbacks, and recommends adopting either/flatMap where it fits while watching team knowledge and interop with existing libraries.
AI-written summary · about
chapters (11)
- 0:00Introduction and speaker intro
- 1:56Why functional programming matters
- 3:43Elements of functional programming
- 8:42Pure functions and side effects
- 9:27Immutability in Kotlin and Java
- 13:01Map, filter, fold and flatMap explained
- 18:49Monads demystified
- 21:42Error handling in Java and Kotlin
- 27:02Either pattern for error handling
- 30:44Monad comprehensions with Arrow
- 32:34Conclusion and recommendations
related talks
29mTreasure.map(): Functional Programming in Kotlin
52mTreasure.map(): Functional Programming in JVM-based languages
48mKotlin & Functional Programming: pick the best, skip the rest
44mKotlin & Functional Programming: pick the best, skip the rest
41mArchitectures Using Functional Programming Concepts
21mExplore Kotlin.Collections API
38mThe Lord of Collection Functions: The Fellowship of Kotlin
50mPure Kotlin.
