How to get methods of functor?
julia> foo() = 2;
julia> foo(x) = x + 2;
julia> methods(foo)
# 2 methods for generic function "foo":
[1] foo() in Main at REPL[21]:1
[2] foo(x) in Main at REPL[22]:1
julia> struct Foo x end;
julia> (obj::Foo)() = obj.x;
julia> (obj::Foo)(x) = obj.x + x;
julia> methods(Foo)
# 1 method for type constructor:
[1] Foo(x) in Main at REPL[1]:1