Pain-free Functional Programming with Java 21
summary
Demonstrates concrete code: use Java 22 records for immutable data, build an Attempt/Or wrapper (success/failure or left/right) to make errors first-class values, and use sealed interfaces with permits so the compiler enforces exhaustive pattern matching in switch expressions. Shows pattern matching with underscore anonymous variables, switch as expression, and how Vavr’s either (flatMap) fails fast while Vavr’s Validation (combine + ap) accumulates errors. Supplies working examples that compile and give exhaustive match checks and multi-error validation.
AI-written summary · about
chapters (10)
- 0:00Introduction to session
- 1:11What is functional programming
- 8:37Immutable data in Java
- 13:53Pure functions benefits
- 17:25Error handling with Attempt
- 27:41Algebraic data types
- 36:57Validation with Either
- 43:00Monads and applicatives
- 48:19Key takeaways
- 50:27Resources and Q&A
related talks
51mFunctional Programming with Java
54mData Focused programming with Pattern Matching in Java
50mModern Java Puzzlers
49mTen Common Mistakes Made in Functional Java 1
52mFunctional Programming with Java 8
48mEmbrace the Func - How Far has Functional Programming Come in Java?
57mTen Common mistakes made in Functional Java
47mIs Java 24 a Functional Programming Language?
