# What is difference between Type{T} and T

**URL:** <https://discourse.julialang.org/t/what-is-difference-between-type-t-and-t/19325>\
**Category:** New to Julia\
**Tags:** type, parametric-types\
**Created:** [January 6, 2019, 3:42pm UTC](https://discourse.julialang.org/t/what-is-difference-between-type-t-and-t/19325 "2019-01-06T15:42:15Z")\
**Posts on this page:** 1\
**Showing post:** 58

<div class="post-metadata">

**Author:** ![path-doc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/path-doc/32/19183_2.png) [@path-doc](https://discourse.julialang.org/u/path-doc)\
**Post date:** [March 17, 2021, 12:18pm UTC](https://discourse.julialang.org/t/what-is-difference-between-type-t-and-t/19325/58 "2021-03-17T12:18:58Z")

</div>

I think an appropriate definition of abstract is one that is complementary to concrete. For then a type y is concrete if, and only if, there exists an object x such that its concrete type \text{typeof}(x) is equal to y. For example,

```Julia
julia> x = [1.0]
1-element Array{Float64,1}:
 1.0

julia> y = Array{Float64,1}
Array{Float64,1}

julia> typeof(x) == y
true

```

Then, since there is no x such that \text{typeof}(x) = \text{Array}, `Array` is an abstract parametric type. `Ptr` is the same.

So then, in line with the manual, Abstract types (such as singleton types and abstract parametric types) may have instances but not “instantiations”. This almost rescues my definition because instances of abstract types are allowed even though instantiations are not!

> **original definition**
>
> > [@path-doc](#):
> >
> > **Definition** : Object x is an _instance_ of the abstract type y if, and only if, the concrete type t\_x of x and the value v\_y of y satisfy t\_x\<:v\_y.

But, in the end, I think the singleton types example means that I have to weaken the definition slightly

> **singleton type example**
>
> > [@path-doc](#):
> >
> > > For each type, T, the “singleton type” Type{T} is an abstract type whose only instance is the object T.
> > 
> > According to my definition, `T` is not an instance of `Type{T}` since
> > 
> > ```julia
> > julia> typeof(Int64)
> > DataType
> > 
> > julia> DataType <: Type{Int64}
> > false
> > 
> > ```

We arrive at:  
**Definition** : Object x is an _instance_ of the abstract type y if, ~~and only if~~ ,

1. the concrete type t\_x of x and the value v\_y of y satisfy t\_x\<:v\_y, or
2. y is a singleton type and x is its instance (can be verified using `isa`)
3. …

---

_[View the full topic](https://discourse.julialang.org/t/what-is-difference-between-type-t-and-t/19325)._
