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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.