What do you mean by "not first class"?
https://docs.julialang.org/en/v1/manual/functions/#man-anony...
https://docs.julialang.org/en/v1/manual/functions/#man-anony...
A function is of type ‘Function’. There is no way to define it with the type of its argument or the type of what it returns.
We don't parameterize a function by it's input and return types because functions are extremely polymorphic in julia. However, there's lots of tricks one can do to dispatch on whether or not a given function have methods that satisfy some sort of interface, see here: https://github.com/oxinabox/Tricks.jl#we-can-use-static_hasm...
Using this technique, you can do compile time dispatch on things like input and return types.
Then dispatch to an error.