# Exist a type tree of all types?

**URL:** <https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913>\
**Category:** General Usage\
**Tags:** question, type\
**Created:** [November 22, 2021, 8:35pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913 "2021-11-22T20:35:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MeteorBizone](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@MeteorBizone](https://discourse.julialang.org/u/MeteorBizone)\
**Post date:** [November 22, 2021, 8:35pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/1 "2021-11-22T20:35:38Z")

</div>

Hello,  
I’am new. Exist a picture with a type tree of all Julia types?

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 22, 2021, 9:18pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/2 "2021-11-22T21:18:13Z")

</div>

Well, the type tree is kind of huge and gets dynamically extended by packages etc. Instead of trying to find and expect a static image, why not explore (branches of) it interactively? E.g.

```julia
julia> using AbstractTrees

julia> AbstractTrees.children(t::Type) = subtypes(t)

julia> print_tree(Number)
Number
├─ Complex
└─ Real
   ├─ AbstractFloat
   │ ├─ BigFloat
   │ ├─ Float16
   │ ├─ Float32
   │ └─ Float64
   ├─ AbstractIrrational
   │ └─ Irrational
   ├─ Integer
   │ ├─ Bool
   │ ├─ Signed
   │ │ ├─ BigInt
   │ │ ├─ Int128
   │ │ ├─ Int16
   │ │ ├─ Int32
   │ │ ├─ Int64
   │ │ └─ Int8
   │ └─ Unsigned
   │ ├─ UInt128
   │ ├─ UInt16
   │ ├─ UInt32
   │ ├─ UInt64
   │ └─ UInt8
   └─ Rational

```

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 22, 2021, 9:31pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/3 "2021-11-22T21:31:18Z")

</div>

Another package for this is `TypeTree.jl`:

```julia
using TypeTree
println(join(tt(Real), ""))

Real
 ├─ AbstractFloat
 │ ├─ BigFloat
 │ ├─ Float16
 │ ├─ Float32
 │ └─ Float64
 ├─ AbstractIrrational
 │ └─ Irrational
 ├─ Integer
 │ ├─ Bool
 │ ├─ Signed
 │ │ ├─ BigInt
 │ │ ├─ Int128
 │ │ ├─ Int16
 │ │ ├─ Int32
 │ │ ├─ Int64
 │ │ └─ Int8
 │ └─ Unsigned
 │ ├─ UInt128
 │ ├─ UInt16
 │ ├─ UInt32
 │ ├─ UInt64
 │ └─ UInt8
 └─ Rational

```

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [November 22, 2021, 11:02pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/4 "2021-11-22T23:02:41Z")

</div>

> [@Diagram with all Julia types?](https://discourse.julialang.org/t/diagram-with-all-julia-types/5018/2):
>
> I recognise two of those graphs… slight_smile A graph showing most of them is a PDF 2129.48 cm wide and only 16.8 cm tall. About 70 feet wide. It could be an interesting project to get it printed. Here’s what the left hand end of the graph looks like (it’s about 5% of the image): Here’s an interesting section to the right:

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 22, 2021, 11:21pm UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/5 "2021-11-22T23:21:52Z")

</div>

@cormullion, how on earth did you generate such a PDF “2129.48 cm wide x 16.8 cm tall” ??? 🙂

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [November 23, 2021, 11:26am UTC](https://discourse.julialang.org/t/exist-a-type-tree-of-all-types/71913/6 "2021-11-23T11:26:40Z")

</div>

I just used the Graphviz default settings, so the more nodes, the bigger the page. I think the biggest PDF page you can have is 15,000,000 inches square, or 38,000,000 cm, so there’s plenty of room for even more types… 🤣
