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 ...

Get Scala Functional Programming Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.