Operators

Flix has a number of built-in unary and infix operators. In addition Flix supports infix function application by enclosing the function name in backticks. For example:

123 `sum` 456

is equivalent to the normal function call:

sum(123, 456)

In addition, a function named with an operator name (some combination of +, -, *, <, >, =, !, &, |, ^, and $) can also be used infix. For example:

def <*>(x: Int32, y: Int32): Int32 = ???

can be used as follows:

1 <*> 2

Precedence

  1. Unary operators (+, -, ~~~, and not)
  2. User-defined operators (including operators defined in the standard library such as |>)
  3. Functions applied infix with backticks
  4. Composition (<+>)
  5. Multiplicative (**, *, /, mod, and rem)
  6. Additive (+ and -)
  7. Shift (<<< and >>>)
  8. Comparison (<=, >=, <, and >)
  9. Equality (==, !=, and <==>)
  10. Bitwise And (&&&)
  11. Bitwise Xor (^^^)
  12. Bitwise Or (|||)
  13. Logical and
  14. Logical or
  15. Channel <-