11 Designing functional programs
In this chapter you will learn
- how to design real-world functional applications
- how to model more complicated requirements as types
- how to integrate with real data-source APIs using
IO
- how to avoid resource leaks
- how to cache query results to speed up execution
—Richard Feynman
This quote has a long history, but the presented formulation is attributed to Kent Beck.
It’s time to put all the knowledge you’ve gained to a good use and implement something tangible! We will use all the functional tools and techniques we learned to follow some very old programming advice: first make the solution work, then make it work correctly, and, only then, think about making it fast. Following are the requirements, which, understandably, are a bit more involved than what we were used to.