I was actually shown this by another Haskeller once, and I agree that Haskell is a very expressive language allowing for a myriad ways of doing things, including the concatenative paradigm.
But I have always doubted that if the language doesn't explicitly endorse a particular paradigm, you will find it pretty awkward to work with other people. Which is why less expressive languages that emphasize particular ways of doing things still make sense.
Re:Elvish – An experimental Unix shell in Go
by notduncansmith on Saturday July 26, 2014 @11:24PM
(#8091855)
Elixir supports that syntax. It's a functional language that runs on the Erlang VM. I found it pretty fun in my experiments, you should check it out: http://elixir-lang.org/
Similarly, Clojure has in its standard library (clojure.core) constructs called 'threading macros' which let you write pipelines just as you would here:
(-> 2
addOne
timesTwo
str
reverse
(apply str)
println)UNIX pipes are just a basic version of what is possible when data structures and objects are combined instead.
Which was possible already in Lisp and Smalltalk based OS.
Combining functions raises the experience to another level. :)
I do take issue with one of the things you wrote though:
> a more complex program is formed by concatenating simpler programs, hence the term "concatenative programming". Compare this to the functional approach, where constructs are nested instead of connected one after another.
There's nothing about the functional approach that necessitates writing "nested" functions, as you describe. With higher-order functions, you can structure your code in almost any arbitrary way. In particular, haskell's >>= operator has this behavior, and you can easily write an operator like
to facilitate something like Or whatever one desires :)