Real, AbstractFloat and Integer with Missing?

dear Julia developers—

If I understand correctly, “Missing” has become an important part of Julia’s future. (keeping 1.0 delayed, too.) I think this makes a lot of sense.

Right now, we have “Real”, “AbstractFloat”, and “Integer” as convenient type catchers for the most important categories of numbers (Ints+Floats, Floats, Ints). Is there a plan to have similar type catchers for these but with Missing Union, or does everybody have to program this themselves?



I am not sure that an abstract type would be less verbose than eg

Union{Missing, AbstractFloat}

There might be some syntax in the future such that Float64? === Union{Nothing, Float64} (or Missing instead of Nothing). It is possible since the ternary operator ? : now requires spaces.

1 Like

more vs. less verbose:

function f(x::MAbstractFloat) = ...

but completely unreadable.

1 Like

everyone please ignore my post. what I really wanted was syntactic sugar for

f( x::Vector{MAbstractFloat} ) = sum(x.^2)

but this does not work out even for plain AbstractFloats, but requires the where notation.

f(x::Vector{<:AbstractFloat}) = sum(x.^2)
1 Like

Or I guess he meant

f(x::Vector{<:Union{AbstractFloat,Missing}}) = sum(x.^2)

this was all a giant misfire. apologies.