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

501 B

Infix operators are Functions of 2 arguments placed between their arguments, rather than before both arguments like regular functions.

a $ b
a + b
a >>= b
-- ...

Infix Position

Arbitrary Functions can also be Applying in an infix position by wrapping them in backticks:

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