arliss_obsidian/fp/Language/Infix Operators/Precedence.md

14 lines
368 B
Markdown
Raw Normal View History

2024-09-23 23:56:55 +00:00
[[Infix Operators|Operators]] must have a precedence, which tells the language in what order to group the expressions.
e.g. in this expression:
```haskell
a + b == c
```
this behaves how you'd expect; this is equivalent to
```haskell
((a + b) == c)
```
This is because the precedence of `+` (6) is higher than `==`'s (4), the grouping is first done around `a + b`.