AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
The Math Reason for Wanting a Right to Left Fold
A right to left fold is something that you would never do in K, because it doesn't make sense going left to right. The reason why it's nice in APL is that what is minus do right it negates its right argument and it adds it to its left argument. And actually the number of times that that a certain value is passes an argument if you include like when the result is passed as well, is equal to its index if you do a right toleft fold. So in math I think it's kind of nicer but in programming a lot of the time you want to just express an iteration with a fold.