Unlocking the Magic of Monads with Java 8
summary
Claim: monads give a practical way to tame callback hell by representing computations as types and chaining them with pure and bind. The talk builds a small Promise type implementing pure and bind using Java 8 lambdas, shows tests for the monad laws (left identity, right identity, associativity), and demonstrates sequencing generic operations across monadic instances. Implementation works locally but is replaced by the JDK solution — uses Java 8 CompletableFuture and Optional as real, tested monadic types that avoid nested callbacks.
AI-written summary · about
chapters (11)
- 0:00Introduction and goals
- 3:50Demystifying monads
- 7:23The callback hell problem
- 11:32Conceptualizing monads
- 15:37Monad interface design
- 19:04Implementing the promise
- 24:27Evaluating the implementation
- 28:41Generic monadic utility
- 32:36The laws of monads
- 37:24Testing monad behavior
- 40:24Monads in the JDK and conclusion
related talks
39mDemystifying Monads with Java
53mLambdas && Monads
42mMonads you already use without knowing it
46mAchieving Functional Programming in Java
36mAn introduction to monadic structures and functional programming
52mFunctional Programming with Java 8
55mFunctional Programming Patterns with Java8
59mDo or don’t There’s no try Or is there The power of monads explained Sort of
