3 ms·
A pipeline operator is just partial application with less power. You should be able to bind any number of arguments to any places in order to create a new funct
by duped 2y ago
A pipeline operator is just partial application with less power. You should be able to bind any number of arguments to any places in order to create a new function and "pipe" its output(s) to any other number of functions.
One day, we'll (re)discover that partial application is actually incredibly useful for writing programs and (non-Haskell) languages will start with it as the primitive for composing programs instead of finding out that it would be nice later, and bolting on a restricted subset of the feature.
- choult 2y ago... and then recreate the scripting language...
- stogot 2y agoI was just thinking does this not sound like a shell language? Using | instead of .function()
- dayvigo 2y agoSure. But how do you write that in a way that is expressive, terse, and readable all at once? Nothing beats x | y | z or (-> x y z). The speed of both writing and reading (and comprehending), the sheer simplicity, is what makes pipelining useful in the first place.
- zelphirkalt 2y agoI like partial application like in Standard ML, but it also means, that one must be very careful with the order of arguments, unless we get a variant of partial application, that is flexible enough to let you specify which arguments you want to provide, instead of always assuming the first n arguments. I use "cut" for this in Scheme. Threading/Pipelines are still very useful though and can shorten things and make them very readable.
- gpderetta 2y agofor loops are also gotos with less power, yet we usually prefer them.