title: type of function in Julia
body: <p>Consider the following bit of code:</p>
  <pre><code>julia&gt; function foo(x::Float64)::Float64
             return 2x
         end
  foo (generic function with 1 method)
  
  julia&gt; typeof(foo)
  typeof(foo)
  </code></pre>
  <p>There must be a reason why <code>typeof(foo)</code> doesn't return something more meaningful, for example <code>(Float64 -&gt; Float64)</code>. What is it?</p>
  <p>I came across this looking at <a href="https://github.com/FluxML/Zygote.jl/blob/master/src/compiler/chainrules.jl#L13" rel="noreferrer"><code>Zygote</code> code</a>.</p>