Real, AbstractFloat and Integer with Missing?


#1

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?

regards,

/iaw


#2

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

Union{Missing, AbstractFloat}

#3

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.


#4

more vs. less verbose:

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

#5

but completely unreadable.


#6

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.


#7
f(x::Vector{<:AbstractFloat}) = sum(x.^2)

#8

Or I guess he meant

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

#9

this was all a giant misfire. apologies.