9 Streams as values

In this chapter you will learn

  • how to declaratively design complicated program flows
  • how to use recursion and laziness to defer some decisions
  • how to handle IO-based streams of data
  • how to create and handle infinite stream of values
  • how to isolate time-dependent functionalities

Thinking is not the ability to manipulate language; it’s the ability to manipulate concepts.

—Leslie Lamport

To infinity and beyond

We have just learned how to read and write data using IO. In this chapter we will still use IO to represent our side-effectful programs as values, but our data will become much bigger—possibly infinite.

You have probably heard about data streams and streaming infrastructures. They have been very popular in recent years. ...

Get Grokking Functional Programming 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.