Railway Oriented Programming - A Functional Approach to Error Handling
summary
Advocates using a dedicated Result/Either type (and functional tools like flatMap/map/pure, Monad Transformers from cats/scalaz, Applicatives, and Futures) to make error flow explicit at compile time instead of ad hoc try/if checks. Demonstrates an update-user controller that composes validations, a DB update and an email send into a readable pipeline and shows how Applicatives can accumulate errors to catch many missed checks.
AI-written summary · about
chapters (17)
- 0:00Start
- 1:25Motivation
- 2:55The Optimistic Approach
- 4:21The Realistic Approach + More Code
- 5:50Functional Approach (2/2)
- 8:11Railway Oriented Programming
- 9:40Switch Functions
- 10:29Composition? (1/2)
- 11:05FlatMap (1/2)
- 12:14Flat Map Example (2/2)
- 13:28Single Track
- 15:10Dead End
- 16:34Exceptions (2/2)
- 18:31Putting It All Together (1/3)
- 24:51I Need to Combine N Objects
- 26:49Using Cats Apply
- 29:01Monad transformers (1/2)
related talks
33mApplying Functional Programming Patterns
43mProgramming Safely in an Uncertain World (Part 2)
29mTreasure.map(): Functional Programming in Kotlin
47mWhirlwind Tour of the Scala Functional Programming Ecosystem
43mEverything You Always Wanted to Know About Functional Programming...
51mPragmatism, Puritanism and Functional Programming
55mLive Coding Eff in Anger
47mIntroduction to Algebraic Effects
