# What does \`\<:\` as a type parameter mean?

**URL:** <https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916>\
**Category:** General Usage\
**Tags:** parametric-types\
**Created:** [February 2, 2023, 11:19am UTC](https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916 "2023-02-02T11:19:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [February 2, 2023, 11:19am UTC](https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916/1 "2023-02-02T11:19:22Z")

</div>

```julia
julia> Array{<:,2}
Matrix{<:} (alias for Array{<:, 2})

julia> Array{<:,2} === Array{<:Any,2}
false

julia> Matrix{<:} isa UnionAll
false

```

I wonder if `Matrix{<:}` means anything?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [February 2, 2023, 11:24am UTC](https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916/2 "2023-02-02T11:24:19Z")

</div>

I think even while `===` returns false, it’s equivalent in use to the expression with `<:Any` because all types are `<: Any` and an empty UnionAll can contain any type.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [February 2, 2023, 11:34am UTC](https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916/3 "2023-02-02T11:34:12Z")

</div>

No, this specifies a `Matrix` with elements of type `<:`, which can’t be instantiated unless you shadow the definition in Base:

```julia
julia> struct <: end

julia> f(x::Array{<:,2}) = x
f (generic function with 1 method)

julia> f(fill(<:(), 2, 2))
2×2 Matrix{<:}:
 <:() <:()
 <:() <:()

```

There are no checks to ensure that the first type parameter of `Array` actually is a type, so `Array{2,3}` is also “valid”.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [February 2, 2023, 12:52pm UTC](https://discourse.julialang.org/t/what-does-as-a-type-parameter-mean/93916/4 "2023-02-02T12:52:35Z")

</div>

To complement @pfitzseb’s answer, I think `Matrix{<:}` is similar to `Matrix{sin}`: in both cases an existing function is used as type parameter. As the [doc](https://docs.julialang.org/en/v1/manual/types/) says, any isbits value can be used as type parameter, and functions are isbits values.
