Operator table
Although we have learned only a handful of operators so far, we present below the complete operator table for Elixir ordered from higher to lower precedence for reference:
Operator | Associativity | |||||
---|---|---|---|---|---|---|
@ |
Unary | |||||
. |
Left to right | |||||
+ - ! ^ not ~~~ |
Unary | |||||
* / |
Left to right | |||||
+ - |
Left to right | |||||
++ -- .. <> |
Right to left | |||||
in |
Left to right | |||||
` | >`<<< >>> ~>> <<~ ~> <~ <~> `< |
>` | Left to right | |||
< > <= >= |
Left to right | |||||
== != =~ === !== |
Left to right | |||||
&& &&& and |
Left to right | |||||
` | |
`or |
Left to right | |||
= |
Right to left | |||||
=> |
Right to left | |||||
` | ` | Right to left | ||||
:: |
Right to left | |||||
when |
Right to left | |||||
<- , \\ |
Left to right | |||||
& |
Unary |
We will learn the majority of those operators as we go through the getting started guide. In the next chapter, we are going to discuss some basic functions, data type conversions and a bit of control-flow.