Getting the type of `f(x)` at compile time (without evaluating `f(x)`), for type-stable functions

I second this. These “other ways” are documented mostly in the source of Julia and the standard libraries though. A more specific question would allow suggesting the right one.

Eg if you are collecting things, I would recommend you look at the functions collect calls, or a functional approach I experimented with.