8 IO as values

In this chapter you will learn

  • how to use values to represent side-effectful programs
  • how to use data from unsafe sources
  • how to safely store data outside your program
  • how to indicate your code does have side effects
  • how to separate pure and impure code

… we have to keep it crisp, disentangled, and simple if we refuse to be crushed by the complexities of our own making …

—Edsger Dijkstra, “The Next Forty Years”

Talking to the outside world

In this chapter we’ll finally address the elephant in the room.


Q I now see how pure functions and trustworthy signatures can help me write ...

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.