arliss_obsidian/fp/Language/Infix Operators/Associativity.md
Orion Kindel 3701b1e2f8
update
2024-09-23 18:56:55 -05:00

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)
```