that seems to do the trick
struct MyType
foo
bar
end
m = MyType(1, 2)
function Base.show(io::IO, ::MIME"text/plain", m::MyType)
if get(io, :typeinfo, Any) === MyType
print(io, m.foo)
else
Base.show_default(io, m)
end
end
julia> m
MyType(1, 2)
julia> [m]
1-element Vector{MyType}:
1