Type System

IntentLang has a rich type system designed for specification clarity.

Primitive types

TypeDescription
UUIDUniversally unique identifier
StringText value
IntInteger
BoolBoolean (true / false)
DateTimeDate and time value

Numeric types

balance: Decimal(precision: 2)

Decimal(precision: N) specifies a fixed-precision decimal number. The precision parameter indicates the number of decimal places.

Domain types

TypeDescription
CurrencyCodeISO 4217 currency code (e.g., USD, EUR)
EmailEmail address
URLURL string

Domain types are extensible — they serve as semantic markers for downstream tooling.

Collection types

items: List<CartItem>       // ordered list
tags: Set<String>           // unique set
metadata: Map<String, Int>  // key-value map
TypeDescription
List<T>Ordered collection of T
Set<T>Unordered unique collection of T
Map<K, V>Key-value mapping

Optional types

Append ? to make a type optional:

locked_until: DateTime?     // may be null
last_login: DateTime?

Union types

Union types define a closed set of possible values:

status: Active | Frozen | Closed

Union variants are enum-like labels (PascalCase). They are not references to other types — Active is a value, not a type.