Let’s Get Lazy: Explore the Real Power of Streams
summary
Demonstrates that laziness yields efficiency by avoiding unnecessary work, showing Haskell’s normal-order laziness, Scala’s lazy vals, and how Java achieves it with Supplier/lambda indirection and the Stream API. Compares an imperative loop (8 checks) to a naive functional view (would seem to do 21 checks) then shows Java Streams actually do 8 checks because intermediate ops are fused and only the terminal op triggers work. Builds infinite streams with Stream.iterate → filter → map → limit → sum (works as shown).
AI-written summary · about
chapters (12)
- 0:00Start
- 0:16What Does It Really Mean by Being Lazy
- 0:40Benefits of Being Lazy
- 4:15Language Specification
- 6:38Using a Debugger
- 11:00Compute Method
- 15:10Does Java Have a Lazy Keyword
- 26:28Advantages
- 32:56Intermediate Operations
- 41:26Referential Transparency
- 42:42Java Guarantee Purity of Lambdas
- 44:56Example of How Infinite Streams Can Help
related talks
47mLet's Get Lazy: Exploring the Real Power of Streams
59mLet's Get Lazy
49mLazy Java
51mIf Streams Are So Great, Let’s Use Them Everywhere... Right??
57mLearning To Code In Functional Style with Java
56mJava Functional Programming Idioms
47mWhen Greed Is Good: Understanding Java Stream Performance
49mJava Streams: Beyond The Basics
