jw3126 / Setfield.jl

Update deeply nested immutable structs.
Other
167 stars 17 forks source link

Dispatch to text/plain show if defined in downstreams #86

Closed tkf closed 5 years ago

tkf commented 5 years ago

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.

jw3126 commented 5 years ago

LGTM!