forked from orion/obsidian
19 lines
501 B
Markdown
19 lines
501 B
Markdown
Infix operators are [[Functions|functions]] of 2 arguments placed between their arguments, rather than before both arguments like regular functions.
|
|
|
|
```haskell
|
|
a $ b
|
|
a + b
|
|
a >>= b
|
|
-- ...
|
|
```
|
|
|
|
### Infix Position
|
|
Arbitrary [[Functions|functions]] can also be [[Applying|applied]] in an infix position by wrapping them in backticks:
|
|
```haskell
|
|
3.0 `mod` 2.0 -- 1.0
|
|
10.0 `mod` 1.0 -- 0.0
|
|
1.0 `div` 2.0 -- 0.5
|
|
1.0 `Number.(/)` 2.0 -- 0.5
|
|
2.0 `Number.pow` 3.0 -- 8.0
|
|
```
|