Trait definitions: type level vs instance level

I think this is a matter of taste. Related thread:

Getting the instance of a singleton type is free. T.instance currently works, though it’s not documented or part of the public interface as far as I know. A guaranteed-to-work way is by relying on incomplete initialization:

struct Helper{T}
  v::T
  Helper{T}() where {T} = new{T}()
end
uninitialized_instance(::Type{T}) where {T} = Helper{T}().v
julia> uninitialized_instance(Nothing) == nothing
true

This is a bit roundabout, but could be abstracted into a tiny package easily. I actually wanted to register such a package, but then gave up because the functionality seemed overly trivial so I wasn’t sure that anyone would use the package.