motivation is from #153
Taking a view intends to minimize allocation. However, for some lazy arrays, allocating a concrete subarray could be more efficient. The proposal is as follows
maybeview(A::AbstractArray, args...) = maybeview(MemoryLayout(A), A, args...)
maybeview(::MemoryLayout, A, args...) = view(A, args...)
maybeview(::AbstractLazyLayout, A, args...) = A[args...] # at LazyArrays.jl
motivation is from #153
Taking a view intends to minimize allocation. However, for some lazy arrays, allocating a concrete subarray could be more efficient. The proposal is as follows