2024-09-23 23:56:55 +00:00
|
|
|
Infix operators are [[Functions|functions]] of 2 arguments placed between their arguments, rather than before both arguments like regular functions.
|
2024-09-22 19:24:51 +00:00
|
|
|
|
|
|
|
```haskell
|
2024-09-23 23:56:55 +00:00
|
|
|
a $ b
|
|
|
|
a + b
|
|
|
|
a >>= b
|
|
|
|
-- ...
|
2024-09-22 19:24:51 +00:00
|
|
|
```
|
|
|
|
|
2024-09-23 23:56:55 +00:00
|
|
|
### Infix Position
|
|
|
|
Arbitrary [[Functions|functions]] can also be [[Applying|applied]] in an infix position by wrapping them in backticks:
|
2024-09-22 19:24:51 +00:00
|
|
|
```haskell
|
2024-09-23 23:56:55 +00:00
|
|
|
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
|
2024-09-22 19:24:51 +00:00
|
|
|
```
|