Skip to main content
Kairo provides a focused set of operators for boolean logic, equality, comparison, and arithmetic. The language deliberately keeps the operator surface small in v0.1 — there is no operator overloading, so every operator has a single, unambiguous meaning. This page documents every operator, the match expression form, member access, and precedence rules.

Boolean Operators

Boolean operators work on Bool values and return Bool. Kairo does not support truthy/falsy coercion — conditions must be explicitly Bool.
Kairo uses the keyword not for logical negation, not !. Writing !active is a syntax error.

Comparison Operators

Comparison operators work on ordered types (Int32, Int64, Decimal, Float64, Text, and temporal types) and return Bool.

Arithmetic Operators

Arithmetic operators work on numeric types (Int32, Int64, Decimal, Float64) and return the same type as the operands.
Integer division truncates toward zero. 7 / 2 produces 3, not 3.5. Use Decimal operands when you need fractional results.

Operator Precedence

Operators are evaluated in the following order (highest precedence first). Use parentheses to override the default order.
When an expression mixes arithmetic and comparison, add parentheses to make your intent clear — it helps readers and avoids subtle bugs.

match as an Expression

The match keyword works both as a statement and as an expression. In expression form, each arm uses => and the whole construct produces a value that you can bind to a let or use inline.
The else arm is the catch-all. In expression form, omitting else when the match is not exhaustive is a compile error.

Member Access — .

Use . to access a member, property, or method on a type instance, a type func on the type itself, or a module-qualified name.
Member access chains left-to-right and has higher precedence than any operator.

No Operator Overloading

Kairo v0.1 does not support operator overloading. Every operator listed on this page has a fixed, built-in meaning. You cannot define custom +, -, or == behaviour for your own types.
Operator overloading is under consideration for a future version of Kairo. Until then, express custom combination logic with named methods (e.g., price.add(other) rather than price + other).

Complete Example