Typically scan, both left and right variants, are O(n) in both space and time. However it seems that APL's \ operator is like scanl but seems to behave differently in that it is right associative and runs over the array each time, making it O(n^2).
For example,
nums ← 10?10 ⍝ 1 7 4 5 10 3 9 6 2 8
⌈\nums ⍝ 1 7 7 7 10 10 10 10 10 10
gives me the correct behavior but by right associativity is equivalent to
(1 f (7 f (4 f (5 f (10 f (3 f (9 f (6 f (2 f 8))))))))) ⍝ where f ← (⊣,⌈)
so the last operation is 1 f (7 7 7 10 10 10 10 10 10)
Isn't this inefficient, what is the actual big O complexity here and/or is there some idiomatic optimization?