Manuscript Documentation
v0.1.0

Types#

Choose a type based on the data you need to represent. Use a record for named fields, an alternative for a fixed set of cases, and an interface for operations a caller needs. Generic types let you reuse a model with different element types.

ConceptWhat you will learn
Records and nominal typesDeclare mutable fields and distinguish domain identifiers.
AlternativesRepresent a fixed set of possibilities with tagged cases.
CollectionsUse mutable lists, maps, and sets with explicit shallow copies.
Optional valuesRepresent absence explicitly with some and none.
Mutation and referencesUnderstand aliases, reassignment, and shallow copies.
Destructuring bindingsUnpack list positions and record fields.
Interfaces and implementationsImplement interfaces with concrete or generic blocks and construct explicit contract views.
Equality and hashingUnderstand value comparison and key eligibility.
Generics and boundsApply parameterized types and express required properties.
Type compatibility and expected typesCheck exact types, contextual constructors, and inference boundaries.