Fear Not The Unknown, My Friend And Go Functional Programming.
summary
Shows how Java can be used functionally by using records for immutable data, implementing a simple Either-like R type and using a Java FP library (Vavr-style Validation) to prove that Validation accumulates errors while Either/flatMap fails fast. Demonstrates Java 17+ features: sealed hierarchies + permits for exhaustive pattern matching, switch pattern matching, and records; builds examples (findUser returning R, validators combining into Person via validation.ap) and contrasts manual constructor wiring with Spring-style DI.
AI-written summary · about
chapters (9)
- 0:00Introduction to functional programming
- 1:14Pure functions and immutability
- 5:26Immutable data structures in Java
- 13:13Functional error handling
- 31:13Algebraic data types
- 33:38Validation with Either and Validation
- 45:46Monads and applicatives
- 46:07Frameworkless dependency injection
- 48:56Key takeaways and recommendations
