3 ms·
agree, I'm using pipelines in Elm, which is almost the same syntax as in OCaml (piping into the last argument). I dislike "<|" b/c of the flexibility syndrome
by nivertech 6y ago
agree,
I'm using pipelines in Elm, which is almost the same syntax as in OCaml (piping into the last argument).
I dislike "<|" b/c of the flexibility syndrome. It's frequently used in Elm in order to avoid parentheses.
Same with Elixir, but it's missing currying, so it does piping into the first argument.
Clojure has both thread-first and thread-last macros.
The problem with these approaches is that they are optional.
Ideally the point-free programming will be the default, not an optional style.
I agree that pipelines in Elm and Elixir are much more readable than point-free code in Forth and APL ;)
Unlike the ML-family languages, in APL/J/K/q you can omit any combination of arguments:
f:{x-y}
f[1] same as f[1; ]
f[;1] same as f[ ;1]
f same as f[ ; ]
- thelazydogsback 6y agoMost Lisps (incl. clojure), Scala, and probably others also allow placed or numbered "holes", so something like: 42 |> f 3 would be the same as 42 |> f 3 _ but you could do: 42 |> f _ 3 to get at the first arg. or even to swap args: 42,43 ||> f %1 %0 which would essentially get expanded to: 42,43 |> fun a b -> f b a (Of course, in this case the closure should get erased by the optimizer to simply "f 43 42".) I really miss not having this in F# (and C# for that matter)