Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I suppose the piping operator is infix.

It's more like composition isn't it?

    object | dothis | dothat
Is pretty much

    dothat(dothis(object))
If stdout is considered the return value at least.

The pipe itself is just a sort of.. notation that a postfix function follows? Whereas in mathematics the function is prefixed, and the notation itself is infix and optional. (That's a knowingly rough and lazy description that any mathematician will hate...)



I think

    dothat(dothis(object))
is more like

    < object dothis | dothat
or

    dothis object | dothat
while the full composition

    object | dothis | dothat
is more like

    dothis(dothat(object(stdin_and_everything_else)))


Yes, true! Same point I think though? I just erroneously gave `object` a different type to `dothis`/`dothat`.


Agreed!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: