Question on functions as parameters

Let’s assume I would like write a function that takes functions as parameters:

function f1(f::Function)
     println("f maps from Float64 to Int64")
end

and I only want to allow functions

function f(x:: Float64) :: Int64
    ...
end

as arguments. Can I do that through the type (ie replace “::function” by something more specific)?

No.

If you have a specific set of functions you’re thinking about, you could form the union of them (since each function is it’s own type). That said, doing so will not be any faster.