3 ms·
> I would be lying if I didn't secretly wish that all languages adopted the `|>` syntax from Elixir. This is usually the Thrush combinator[0], exists in other
by AdieuToLogic 2y ago
> I would be lying if I didn't secretly wish that all languages adopted the `|>` syntax from Elixir.
This is usually the Thrush combinator[0], exists in other languages as well, and can be informally defined as:
f(g(x)) = g(x) |> f
0 - https://leanpub.com/combinators/read#leanpub-auto-the-thrush https://leanpub.com/combinators/read#leanpub-auto-the-thrush
- Munksgaard 2y agoNot quite. Note that the Elixir pipe puts the left hand of the pipe as the first argument in the right-hand function. E.g. x |> f(y) = f(x, y) As a result, the Elixir variant cannot be defined as a well-typed function, but must be a macro.