- allows us to add structure to the values in our programs
- defining our own types also imrpoves the safety of our code
- haskell will not allow us to accidentally mix values of two values that are structurally similar but have different names.
-- file: ch03/BookStore.hs data BookInfo = Book Int String [String] deriving (Show)
- The BookInfo after the
datakeyword is the name of our new type. We call BookInfo a type constructor.
Bookthat follows is the name of the value constructor (sometimes called a data constructor)
Book, the Int, String, and [String] that follow are the components of the type.