# Real, AbstractFloat and Integer with Missing?

**URL:** <https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402>\
**Category:** Internals & Design\
**Created:** [April 18, 2018, 2:09am UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402 "2018-04-18T02:09:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [April 18, 2018, 2:09am UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/1 "2018-04-18T02:09:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [April 18, 2018, 5:59am UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/2 "2018-04-18T05:59:07Z")

</div>

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

```julia
Union{Missing, AbstractFloat}

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [April 18, 2018, 9:38am UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/3 "2018-04-18T09:38:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [April 18, 2018, 3:25pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/4 "2018-04-18T15:25:40Z")

</div>

more vs. less verbose:

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

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [April 18, 2018, 3:34pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/5 "2018-04-18T15:34:23Z")

</div>

> [@iwelch](#):
>
> more vs. less verbose:

but completely unreadable.

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [April 18, 2018, 4:10pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/6 "2018-04-18T16:10:30Z")

</div>

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

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

```

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

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [April 18, 2018, 4:11pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/7 "2018-04-18T16:11:29Z")

</div>

```julia
f(x::Vector{<:AbstractFloat}) = sum(x.^2)

```

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [April 18, 2018, 4:40pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/8 "2018-04-18T16:40:26Z")

</div>

Or I guess he meant

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

```

---

<div class="post-metadata">

**Author:** ![iwelch](https://avatars.discourse-cdn.com/v4/letter/i/8c91f0/32.png) [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Post date:** [April 18, 2018, 8:31pm UTC](https://discourse.julialang.org/t/real-abstractfloat-and-integer-with-missing/10402/9 "2018-04-18T20:31:44Z")

</div>

this was all a giant misfire. apologies.
