Re:Pipelining might be my favorite programming language feature
by bnchrch on Monday April 21, 2025 @11:59AM
(#43753431)
FWIW you can pass to other arguments than first in this syntax
```
params
|> Map.get("user")
|> create_user()
|> (¬ify_admin("signup", &1)).() ```
or
```
params
|> Map.get("user")
|> create_user()
|> (fn user -> notify_admin("signup", user) end).() ```
Re:Pipelining might be my favorite programming language feature
by Terr_ on Monday April 21, 2025 @02:20PM
(#43754857)
BTW, there's a convenience macro of Kernel.then/2 [0] which IMO looks a little cleaner:
params
|> Map.get("user")
|> create_user()
|> then(¬ify_admin("signup", &1))
params
|> Map.get("user")
|> create_user()
|> then(fn user -> notify_admin("signup", user) end)
[0] https://hexdocs.pm/elixir/1.18.3/Kernel.html#then/2
Re:Pipelining might be my favorite programming language feature
by AndyKluger on Tuesday April 22, 2025 @09:14AM
(#43761720)
Do concatenative langs like Factor fit the bill?
Is there any language with a single feature that gives the best of both worlds?