Suppose I define a new type
struct foo x::Int end
and I create a vector
foos = [foo(3), foo(2), foo(9), foo(7)]
Now, I want a function that I could call as
What is the best way to achieve that?