forked from orion/obsidian
15 lines
419 B
Markdown
15 lines
419 B
Markdown
|
[[Infix Operators]] are left-, right- or non-associative _(`infixl`, `infixr`, `infix` respectively)_
|
||
|
|
||
|
When multiple infix operators with the same associativity & precedence are chained, associativity tells the language how to group the expressions.
|
||
|
|
||
|
e.g. `&&` is right-associative, while `*` is left associative:
|
||
|
```haskell
|
||
|
|
||
|
a && b && c
|
||
|
-- interpreted as
|
||
|
(a && (b && c))
|
||
|
|
||
|
a * b * c
|
||
|
-- interpreted as
|
||
|
((a * b) * c)
|
||
|
```
|