Context: I'm playing with pretty-printer for Kaleido.jl https://github.com/tkf/Kaleido.jl/pull/6 and noticed that there is no easy way to extend show(io::IO, ::MIME"text/plain", l::Lens). For example, if I call show(stdout, "text/plain", mylens ∘ (@lens _.a)), Julia calls show(::IO, ::MIME"text/plain", ::Any) which calls show(::IO, ::ComposedLens). So, by the time my show method is called, the mime type is gone.
I think the easiest would be to pass around the mime type in Setfield.jl.
Context: I'm playing with pretty-printer for Kaleido.jl https://github.com/tkf/Kaleido.jl/pull/6 and noticed that there is no easy way to extend
show(io::IO, ::MIME"text/plain", l::Lens)
. For example, if I callshow(stdout, "text/plain", mylens ∘ (@lens _.a))
, Julia callsshow(::IO, ::MIME"text/plain", ::Any)
which callsshow(::IO, ::ComposedLens)
. So, by the time myshow
method is called, the mime type is gone.I think the easiest would be to pass around the mime type in Setfield.jl.