Lazy Java
summary
Shows how to implement laziness in Java 8 with concrete code: builds an infinite Stream 'from' and a custom lazy list that defers evaluation, demonstrates a palindrome recursion that causes stack overflow and fixes it with a trampoline to linearize recursion which actually runs on very long inputs, and implements a Reader monad replacing DI so dependencies are injected at evaluation time not construction time. Emphasizes profiling before optimizing and shows the live coding examples compile and execute as claimed.
AI-written summary · about
chapters (15)
- 0:00Lazy evaluation in Java
- 6:13Lazy streams performance
- 9:46Lazy vs imperative code
- 11:15Prime numbers with lazy streams
- 15:00Lazy lists in Java
- 20:11Internal vs external iteration
- 23:02Stack overflow and tail calls
- 26:41Trampolining to avoid overflow
- 31:10Lazy evaluation vs DI
- 33:15Reader monad for context
- 37:39Reader monad example
- 40:19Single-step execution
- 43:19Reader monad details
- 46:12When to use lazy evaluation
- 48:47Q&A
related talks
50mLet’s Get Lazy: Explore the Real Power of Streams
59mLet's Get Lazy
47mLet's Get Lazy: Exploring the Real Power of Streams
54mLaziness, trampolines, monoids and other functional amenities
59mLet's Get Lazy
49mJava Streams: Beyond The Basics
38mJava 8: Functional programming
58mLet’s Get Lazy—The Real Power of Functional Programming
