Part 2. Functional design and combinator libraries

 

In part 1, we took a radical stance to rethink how we approach programming using pure functions without side effects. This approach has allowed us to solve problems in ways vastly different than what we’re accustomed to. We learned about looping, data structures, exception handling, and dealing with state changes, all while using only pure functions. This has equipped us with many building blocks that we can use to solve more complex problems.

Part 2 of this book is all about applying the knowledge gained in part 1. We put this knowledge to use by designing and writing libraries that perform common tasks that we expect to see in the real world. In chapter 7, we write a library that handles parallel and asynchronous communication. Chapter 8 sees us writing a property-based testing framework, and chapter 9 demonstrates how we can build a string-parsing library.

These chapters aren’t about teaching you parallelism, testing, or parsing—many other books have been written about these topics, and those aren’t what we are trying to teach. Instead, these chapters focus on how we go about the process, not what we are building. We apply our functional building blocks to solve complex problems in the real world by designing purely functional libraries for any domain—even domains that don’t resemble those presented here.