Chapter 8
Types & Data
One keyword, type, builds everything: records, enums, and tagged unions are the same construct with a different number of variants. You build a value by naming its type, read a record’s field with a dot, open a union with match, and “change” a value by deriving a new one with with — never by mutating. Naming your shapes up front is the whole game, and the compiler catches every typo along the way.