Operator Description Example +Addition a + b-Subtraction / negation a - b, -x*Multiplication a * b/Division a / b%Modulo a % b
Equality operators compile to strict equality (===, !==). Structural equality is used for == between same types.
Operator Description Compiles to ==Equal ===!=Not equal !==<Less than <>Greater than ><=Less or equal <=>=Greater or equal >=
Operator Description Example &&Logical AND a && b||Logical OR a || b!Logical NOT !a
Operator Description Example |>Pipe x |> f
The pipe operator passes the left side as the first argument to the right side. Use _ as a placeholder for non-first-argument positions.
x |> match { . .. } // match x { ... }
Operator Description Example ?Unwrap Result/Option expr?
The ? operator unwraps Ok(value) or Some(value), and returns early with Err(e) or None on failure. Only valid inside functions that return Result or Option.
Operator Description Example tryWrap unsafe npm call in Result try parseYaml(input)
The try operator wraps a potentially throwing npm function call in a Result<T, Error>. Required for non-trusted npm imports.
Operator Context Example ..Record spread in constructors User(..existing, name: "New")..Array rest in match patterns [first, ..rest]...Type spread in record definitions type B { ...A, extra: string }1..10Range pattern in match match n { 1..10 -> "small" }
Operator Context Meaning (x) =>Closures (x) => x + 1.fieldDot shorthand .name (implicit field-access closure)->Match arms, return types, function types Ok(x) -> x, fn add(a) -> number, (string) -> number|>Pipes data |> transform
Unary: !, -
Multiplicative: *, /, %
Additive: +, -
Comparison: <, >, <=, >=
Equality: ==, !=
Logical AND: &&
Logical OR: ||
Pipe: |>
Unwrap: ?