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 — + - * / % ** +% -% % +| -| | & | ^ ~ << >> && || !
- 1.2 Statement termination — A statement is terminated by ; or by a line break.
- 2.2 Import — The first segment of the path MUST be std, self, super or the name of a dependency from oxl.toml.
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
use std.time { Duration, now }
use std.http.{Client as Http}
use self.billing { charge } // a module of one's own package
use super.common { Money } // the parent module
use auth.tokens { verify } // a dependency from oxl.toml
use parsers { <|> } // importing an operator
use std.coll.* // all pub names (a warning in libraries)Related diagnostics
chained-comparison, not-callable, not-overloadable, operator-decl, range-not-iterable, invalid-char, bad-import-root, glob-import, import-conflict, unresolved-import, unresolved-name