November 2019
Intermediate to advanced
336 pages
11h 30m
English
This chapter covers
In chapter 2, we looked at some common primitive types that form the building blocks of a type system. In this chapter, we’ll look at ways to combine them to define new types.
We’ll cover compound types, which group values of several types. We’ll look at how naming members gives meaning to data and lowers the chance of misinterpretation, and how we can ensure that values are well-formed when they need to meet certain constraints.
Next, we’ll go over either-or types, which contain a single value from one of several types. We will look at some common types such as optional types, ...
Read now
Unlock full access