<i>"Surely I was not the first to write the following two higher-order programs..."</i><p>He's right.  There is, for example, <i>rc</i> (the Plan 9 shell, made in 1989).<p>The following is from section 10, "Pipeline branching" of:  <a href="http://plan9.bell-labs.com/sys/doc/rc.html" rel="nofollow">http://plan9.bell-labs.com/sys/doc/rc.html</a><p><i>"&#60; or &#62; followed by a command in braces causes the command to be run with its standard output or input attached to a pipe. The parent command (cmp in the example) is started with the other end of the pipe attached to some file descriptor or other, and with an argument that will connect to the pipe when opened (e.g., /dev/fd/6)."</i>