Would it make sense to add this at the beginning of your project?
for T in collection_of_types
@eval const $(Symbol(T, :_)) = Union{$T, Missing}
end
(with collection_of_types being a collection of all the types with possible missing values you are working with, and replacing :_ by any suitable symbol you want to append to the type names for aliasing them).
I’d rather have one of them (which ever) than none at all… I guess we could scan all the registered packages and see what it more common, Missing or Nothing…?
I’m pretty sure I’ve mentioned this elsewhere, but I just want to repeat that I think that T? is really ugly syntax. The first reason for this is that there are very few right unary operators in Julia. The only exception I am aware of is ', which I think is a much better case because the notation for adjoint or transpose as a right unary operator is universal (something that cannot be said for a short-hand of Union{T,Missing}). The second reason is that the logical implication syntax a ? b : c is valid and often used in Julia, and when I see T? my first instinct is that I’m looking at a broken ternary operation.
I recall that @Tamas_Papp had some nice suggestion for an alternative, but I can’t remember what it was at the moment, it might have been something like U(T,Missing). I also think it would be nice to have a notation that might be a little bit of extra typing, but is both explicit about whether it is using Nothing, Missing or something else, and general enough to be extensible to all binary type unions.
I can’t recall anything, sorry. In fact, I think I was against any clever syntax, I find the explicit Union{...} much cleaner. For frequent application one can always define an alias.