# Vectors of Unions between concrete type and singleton type

**URL:** https://discourse.julialang.org/t/vectors-of-unions-between-concrete-type-and-singleton-type/101158
**Category:** General Usage
**Created:** [July 4, 2023, 9:23am UTC](https://discourse.julialang.org/t/vectors-of-unions-between-concrete-type-and-singleton-type/101158 "2023-07-04T09:23:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [July 4, 2023, 9:23am UTC](https://discourse.julialang.org/t/vectors-of-unions-between-concrete-type-and-singleton-type/101158/1 "2023-07-04T09:23:55Z")

</div>

According to [the docs](https://docs.julialang.org/en/v1/manual/missing/#Arrays-With-Missing-Values), `Vector{Union{Missing, <:Any}}` can be fast fast because they use a special memory layout to mark “missing” fields.  
Is that special handling for `missing`, or is it true for Arrays of all singleton unions, such as `Union{Nothing, <:Any}` or `Union{Makie.Automatic, <:Any}`?

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [July 4, 2023, 9:36am UTC](https://discourse.julialang.org/t/vectors-of-unions-between-concrete-type-and-singleton-type/101158/2 "2023-07-04T09:36:27Z")

</div>

Any ruins everything, nothing is gonna be fast if you have abstract type in array

But otherwise, it’s true for all singletom

---

<div class="post-metadata">

### Author: ![hexaeder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexaeder/32/24403_2.png) [@hexaeder](https://discourse.julialang.org/u/hexaeder)
#### Post date: [July 4, 2023, 9:38am UTC](https://discourse.julialang.org/t/vectors-of-unions-between-concrete-type-and-singleton-type/101158/3 "2023-07-04T09:38:42Z")

</div>

By writing `Union{Missing, <:Any}` I meant that the second type in the Union is a concrete subtype and bitstype, similar to the Missing case.

> But otherwise, it’s true for all singletom

okay, thanks!
