May 6, 2018

Real World Haskell -- Chapter 3

This chapter is an amazing example of concepts poorly explained and poorly illustrated The start of chapter 3 introduces the "data" statement via a muddled example involving a Bookstore. These pages are worse than useless. Go read chapter 7 in "learn you a Haskell" and whatever you do, don't continue in the "real world" book until you have a firm grasp on how this works.

A distinction to have clear in your mind is that the word "data" is used in Haskell to define new types. The word "type" is merely used to define type synonyms, and is much less commonly used. A good introductory book would underscore this. In fact a good introductory book would first give a basic explanation of new concepts, and then illustrate how to use them.

It would be good to introduce "newtype" at the same time, but this must wait until chapter 6, where it gets introduced in the midst of the JSON example.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org