Skip to content

Types

A type determines what shape a value has and what you can do with it.

You write the program body as a class (the shape of a program). Otherwise, when you define your own type, you use one of struct, record, enum, or union. class only allows declaration; instantiation and read/write are rejected (struct and record).

PageForms that compileForms that don’t compileContents
Primitive types51
Arrays4819An array holds a fixed number of values of the same type, decided in advance.
Enums72
struct and record347
Tuples102
union (sum type)83
Generics2911
Interfaces239