in the MWE
using StaticArrays
flat_outer_product(f::F, a, b) where {F} = mapreduce(a -> map(b -> f(a, b), b), vcat, a)
a = SVector(1, 2)
b = SVector(2, 3)
@code_warntype flat_outer_product(SVector, a, b) # does not infer
@code_warntype flat_outer_product((a, b) -> SVector(a, b), a, b) # infers
the first call does not infer, the second does.
Is arity the problem? I thought it was implied by the way f
was used. Can someone please explain what is going on?
Should I open an issue about this?