O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Lazy Sequences – Being Lazy, Being Good

In life, we (hopefully) spend money only on things that we really need. For example, I keep eyeing those ever powerful laptops being advertised every day. I drool over those shiny machines with hefty RAM sizes and lightening processor speed. The buy button is so inviting!

I am sure, at times, you must have felt similar buying urges. However, as you know well, we just don't buy it willy nilly. We think, plan, and buy if we really need it. Simply, because we have limited money, we need to spend it carefully.

A software system, too, has limited resources. When a system needs to acquire an expensive resource, the resource should be obtained when it is really needed,that is at its first use. If the system ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required