hmmm maybe. Maybe I’m missing something here and I know this was brought up in the context of generator pipelines. But a generator pipeline is just a use case of function composition. Other than reversing associativity and using different symbols for the operator I don’t see it as much different. But maybe you’re thinking about something I’m not or have some perspective I don’t.
It’s the order in which the functions are listed. (Maybe that’s "reversing the order of associativity?)
With @
for function composition you write functions the same order as ‘normal’, with the last applied function to the left.
With a pipeline, (or pseudo-universal function call syntax as I like to think of it,) you write the last applied function to the right. (Or at the bottom, as I prefer.)
Either way you get rid of brackets that are very far separated from their closing bracket, which is nice.
But changing the order in which functions are listed isn’t unimportant (to me).
yeah that’s what I meant by reversing the order. I could totally be using that wrong. I meant it in the sense that @
is an operator and g
and f
are the left and right operands respectively.
Yeah I don’t have too strong of an opinion on the order really. I could see pros and cons for both. I’d be happy if it was added either way. It’s still just composition or pseudo-universal function call, if you prefer.
Not really a serious suggestion but this talk of wring a series of function calls in the order they’re called makes me wonder how putting the arguments before the function name would go down…
((4, ((1, 2)do_something, 3)then_do_something_else)and_another_thing)print
((1)__add__.(1)int)__mul__.(2)int
This is the Reverse Polish Notation I used on my HP calculator during the last century!