A type object is a machine-processable representation of a specific type. It uses a concept label to identify the type class and settings to capture properties such as a unit. This structured form avoids fragile string manipulation and leaves room for hierarchies or parameterized types. section 13.3 section 13.4
A type object separates general type identity from type-specific settings:
- Number Type with unit "$" represents amount; unit "%" represents percentage. section 13.3
- Interval Type with unit "day" represents a date range whose values are date pairs. section 13.3
- Untype represents the absence of a sensible computed type. section 13.3 section 13.4
- Equality can use a stable identifier, while rendering converts the structured object back into readable type text. section 13.3
Using type objects during checking
Constraint checking computes the type of an attribute and the type of an AST value, compares the two type objects, and reports both rendered types when they differ. The same representations drive operator type computation and user-interface projections that display $, %, or days. section 13.3 section 13.4
Table 13.1 The type objects for built-in types
|
Type name
|
ID
|
Concept label
|
Settings
|
|---|---|---|---|
amount
|
numberType_amount
|
Number Type
|
{ "unit": "$" }
|
date range
|
numberType_dateRange
|
Interval Type
|
{ "unit": "day" }
|
percentage
|
numberType_percentage
|
Number Type
|
{ "unit": "%" }
|
untype
|
untype_untype
|
Untype
|
{}
|
The built-in type table maps readable names to identifiers, concept labels, and settings. section 13.3
