Following from related discussion Keeping Up With The Cartesians - Findall Return Type
I understand that findall
returns a list of CartesianIndex
for a Matrix
, which I guess makes sense.
But compare this to eachindex
which returns an iterable object with the most efficient indexing (linear for Matrix
)
pairs
allows an argument to specify the indexing style:
pairs(IndexLinear(), A)
pairs(IndexCartesian(), A)
pairs(IndexStyle(A), A)
Is it unreasonable that findall
return the IndexStyle
of the argument?