Type Intersection in Arrays

I guess we need a function like this:

function promote_entries(A::AbstractArray)
    T = mapreduce(typeof, promote_type, A)
    convert(Array{T}, A)
end

Currently this doesn’t seem to be optimized when A is homogeneous, which is a bit annoying but could easily be fixed by handling that situation manually.

2 Likes