January 2023
Intermediate to advanced
648 pages
17h 32m
English

The idea that every expression has a type is central to Haskell. Haskell has several built-in types available to us in the Prelude and a system for making our own types. In this chapter, we’ll discuss some of the built-in types, and in Chapter 10, we’ll see how to make types of our own.
Types reflect the nature of information. For example, in physics, we want to know whether something is a scalar or a vector. These are different types. It makes no sense to add a scalar to a vector, and the computer can prevent us from making this mistake if we use a good system of types.
Table 3-1 shows Haskell’s most important ...
Read now
Unlock full access