op ~
~
Defined in
- 5.2 Precedence and associativity — Precedence and associativity
- 5.3 Overloading and user-defined operators — Overloading built-in operators — op declarations in impl
- 1.6 Operators and delimiters — + - * / % ** +% -% % +| -| | & | ^ ~ << >> && || !
- 8.4 Chains — A chain links asynchronous steps so that either the whole chain is executed or the first unhandled error is returned.
- 1.2 Statement termination — A statement is terminated by ; or by a line break.
Examples
operator <|> <T>(a: Parser<T>, b: Parser<T>) -> Parser<T> infixl 3 => a.orElse(b)
operator ~~ (s: str, re: Regex) -> bool infix 4 => re.matches(s)
operator ^^ (a: f64, b: f64) -> f64 infixr 12 => a.pow(b)
operator ¬ (b: Bits) -> Bits prefix => b.invert()— 5.3 Overloading and user-defined operators
let page = Users.get(id)
-> (Orders.recent(it.id), Recs.for(it.id))
-> (orders, recs) => Page{ orders, recs }
~> Audit.log("page", id)
!> Timeout => Page.empty()
within PAGE_DEADLINE
retry 2
let html = await pageRelated diagnostics
chained-comparison, not-callable, not-overloadable, operator-decl, range-not-iterable, invalid-char, it-outside-chain