Abstractions let different values share one way to act. A receipt, an order, and a ticket can all have a way to show text. The data stays different, but the action name can stay the same.
Musi uses shape for this shared behavior. A given value says how one type follows the shape. A law states a rule the behavior should keep.
This part teaches shapes, given values, laws, and contextual capabilities. Use it after records and data variants feel familiar.
The main idea is practical: give behavior a name without forcing all data to look the same.
Chapters
Abstractions
Chapter»ShapesA shape says which behavior a type must provide.Chapter»Given valuesA given value says how a type follows a shape.Chapter»LawsA law states an expected rule for a shape or behavior.Chapter»Contextual capabilitiesA contextual capability lets code ask for behavior without passing it by hand each time.