A ReverseView would compose better than extra keywords to functions. If the performance penalty is not too large, it would be my preferred solution, as a middle ground between optimized loops and copying operations.
SubArray already supports this. Try view(a, lastindex(a):-1:firstindex(a)). (using Compat for firstindex and lastindex on 0.6.)
Having an accumulate function that works on iterators would be great, though it is tricky to make fast and type-stable. Here, however, note that cumsum on floating-point arrays is actually much more accurate than any iterator-based version because it uses pairwise summation. Also, I suspect that the original use-case in this thread might want to use cumsum! so that it could operate in-place, and that wouldn’t be possible for iterators.
Could it support multi-dimensional arrays too? Via a dim keyword,
R = ReverseView(A; dims=(2,4))
would reverse indices along dimensions 2 and 4, whereas dimensions 1, 3 (or any other dimension) map to the original array unchanged:
R[i,j,k,l] == A[i, end - j + 1, k, end - l + 1]
To achieve this with view, it seems necessary to specify what happens for each dimension explicitly,
R = @view A[:, lastindex(A,2):-1:firstindex(A,2), :, lastindex(A,4):-1:firstindex(A,4)]
which is considerably more verbose and harder to read. It’s also harder to write in a context where A has an unknown number of dimensions but you know that dimension 2 has to be reversed (which admittedly need not be that common).