From Exception Hell to Typed Bliss: Real-World Error Handling with Kotlin and Arrow
summary
Team migrates exception-heavy Kotlin code to Arrow using Arrow's Raise DSL and Either for months, keeping direct-style control flow while gaining compile-time error guarantees. Implementation specifics: replace throws with raise, use typed ADTs for domain errors, add a linter to catch forgotten binds, and use error accumulation selectively. Pain points include error-ADTs causing module coupling and experimental context parameters for multi-receiver cases, but overall the approach runs in production and reduces surprising runtime exceptions.
AI-written summary · about
chapters (12)
- 0:00Real-world error handling intro
- 3:21Problems with exceptions
- 7:18Typed errors improve reasoning
- 10:09Monads for error handling
- 13:06Arrow Either direct-style
- 15:56Lessons after months
- 20:35Modeling domain errors
- 22:43Error accumulation issues
- 24:08Future Kotlin features
- 27:57Union types read errors
- 29:24FP in mainstream languages
- 30:50Summary
related talks
47mFunctional programming in Kotlin: exploring Arrow
42mDesign for errors - An introduction to Domain Modeling with Arrow
40mArrow of Outrageous Error Handling
30mFunctional programming in Kotlin: exploring Arrow
41mAn Arrow to the Kotlin
43mError Handling Strategies for Kotlin Programs
27mLeveraging the power of Arrow
50mState of the functional ecosystem in Kotlin: Mid 2018 checkup
