chapter five
This chapter covers
- Using the record syntax to define data types that are maintainable and easy to work with
- Defining your own type classes for data conversion
- Generalizing concepts such as appending and slicing data
- Handling text effectively with language extensions
- Using foldings to effectively work with complex data
- Writing powerful data transformations with the help of functors
- Manipulating complex workflows based on user interaction
In the last chapter we tackled a search problem and wrote a powerful artificial intelligence for a childrens game. In this chapter however, we want to take care of earnest business and nothing screams business like spreadsheets! Don’t worry, we will not deal with any data directly. As programmers we obviously want to automate such tasks and the easiest way for us to deal with data in spreadsheet form are CSV files!
In this chapter we will cover how to parse such files, extract meaningful data from them, and how to work effectively with structured data. We will learn how to generalize appending and slicing of data and how to bring type classes into the mix to help us write our program.