Recall that in Chapter 6 we used an infinite list to simulate a mathematical sequence used in the calculation of the perimeter of an ellipse. When a list is used in a context where it will always be infinite, it is commonly called a *stream.* Many problems can be elegantly, concisely, and efficiently expressed using streams, which we will explore in this chapter. With the power of streams there are also inherent dangers, which we will also explore. In the next chapter we will use streams in a central way in the implementation of a language for expressing reactive animations.

**14.1 Lazy Evaluation**

Because streams are never finite, it would seem natural to define a special polymorphic data type ...

Start Free Trial

No credit card required