A type tells you what kind of value a name holds. Int is a number. String is text. A record type can say which fields exist.
Types are like labels on boxes. The label does not make the thing. It helps you and Musi know what belongs inside.
This part teaches type annotations, inferred types, optional and fallible types, callable types, generics, and type checks.
Use type notes where they make code clearer. Let Musi infer the rest when the code already says enough.
Chapters
Types
Chapter»Type annotationsA type annotation says what kind of value a name should hold.Chapter»Type inferenceMusi can infer many local types from the expression on the right.Chapter»Optional and fallible typesOptional and fallible types keep missing values and errors visible.Chapter»Callable typesCallable types describe functions and effectful calls.Chapter»GenericsGenerics let code keep one shape while the item type changes.Chapter»Type tests and castsType tests ask about a type. Casts assert a type.