3 ms·
What? > From shell's point of view, the filters -- echo and cat -- are pure, referentially-transparent functions of their arguments Yes, in this somewhat biza
by peteretep 9y ago
What?
> From shell's point of view, the filters -- echo and cat -- are pure, referentially-transparent functions of their arguments
Yes, in this somewhat bizarre, contrived, tautological use of `cat`, maybe. But `cat` is more commonly used not as an identity function (the explicit identification of which would seem to strengthen the author's case, but isn't made), but as a way of pulling in data external to the command-line input, making it neither pure nor referentially transparent.
> Operator | (a pipe), "forces" a command, which is a promise of output, on its left producing a stream, an argument for a command on the right-hand side of the pipe
That seems to be more simply a description of function composition, rather `>>=`, which concatenates functions that have multiple output modes.
Indeed:
> UNIX filter is expected to sequentially consume its input and produce a single output stream
is suggestive that filters on the command line have no side-effects, which is not a typical usage of the term.