REPL output for subtype of Function


#1

How is one meant I override the default output in the REPL? This early thread Proper way to hook into REPL display of type seems to suggest using show, but this doesn’t work for subtypes of Function:

julia> struct Foo <: Function end

julia> Base.show(io::IO,::Foo) = print(io, "hello")

julia> Foo()
(::Foo) (generic function with 0 methods)

julia> show(Foo())
hello

#2
julia> struct Foo <: Function end

julia> Base.show(io::IO, ::MIME"text/plain", ::Foo) = print(io, "Hello")

julia> Foo()
Hello