Hello! I guess that this might have been discussed somewhere. But I couldn’t find it. I’ll put an example to show the problem, which in my opinion needs at least some consideration
julia> vcat(1,2) == reduce(vcat, [1,2])
true
On the other hand,
julia> vcat(1) == reduce(vcat, [1])
false
which I find it problematic. The problem comes from reduce which behaves differently when a single element is passed as a second argument. Moreover the type is not the same neither if a single element is passed
julia> reduce(vcat, ["a"])
"a"
julia> reduce(vcat, ["a",["b","c"]])
3-element Vector{String}:
"a"
"b"
"c"
I found myself using it together with an extra vcat to avoid this corner-case
julia> vcat(reduce(vcat, ["a"]))
1-element Vector{String}:
"a"
julia> vcat(reduce(vcat, ["a",["b","c"]]))
3-element Vector{String}:
"a"
"b"
"c"
UPDATE: It seems to work and since the type-instability was indeed into the array itself, I think this can be a solution for this case. Thanks @lawless-m and thank you all for your help. Interesting to find these issues you mentioned.