julia
julia copied to clipboard
[docs/base] add a type tree for `Number`
ref: https://github.com/JuliaLang/julia/issues/24741
Generated using the following code with manual modifications
- Sort by type size
- Move
AbstractIrrationalto the end
using AbstractTrees
AbstractTrees.children(x::Type) = subtypes(x)
print_tree(Number)
preview

Can you add a blurb before the tree that describes what it shows? Does it make sense to also add an indication which ones are abstract types since the Abstract* prefix is not used for all abstract number types?
Any more comments?
Should we mark which types are primitive or struct types?
Marking primitives seems noisy. Perhaps we should just mark struct types and indicate the rest are primitive types?
The struct types according to isstructtype are:
- BigFloat
- BigInt
- Irrational
- Rational