In Julia we have typeintersect(Missing, Union{Missing, Float64})
(returning Missing
).
Is it possible to get what remains instead (i.e. Union{Missing, Float64} - Missing
returning Float64
)?
I did try with typesubtract(Missing, Union{Missing, Float64})
or typecomplement(Union{Missing, Float64}, Missing)
but obviously they don't exist ;-)
For
Missing
it is actually implemented in Base (but not exported) asnonmissingtype
function. Here you have the relevant code:So this should probably solve your issue with
Missing
(justimport
this function fromBase
) and you have a template how a similar thing can be implemented for other scenarios. Please let me know if it answers what you wanted.