Is there a package that implements an array type where the index is reversed? I have an array that I would normally reverse the order but I don’t really want to incur an extra allocation cost or performance hit. So it would be nice to reference a[1] for the a[end] element and vice versa.
I thought it would be simple enough to create a custom array type but don’t want to reinvent any wheels…
FWIW, as your ReverseVector is immutable, you could store length(v.ar) as separate field to avoid a call everytime you index. Don’t know if/how much this really matters, though. Same for size(v.ar).