There is a common pattern for many utility programs: we have some data in a form that is not convenient for analysis and want to present the data, visually or textually. While implementing such a program, we have to address many issues, such as interfacing with a user, designing data types for an application domain, reusing external packages for parts of the program, and more. We should also think about language features that can help us in terms of correctness, performance, and an ability to extend functionality, if needed.
In this chapter, we’ll explore the process of developing such a program. I’ll start by describing inputs and outputs, then move on to design issues with data types, functions, and modules, followed by a discussion of useful Haskell packages and implementation details. We’ll also see how type classes can make our programs much more flexible and resilient to changes.