julia icon indicating copy to clipboard operation
julia copied to clipboard

[docs/base] add a type tree for `Number`

Open inkydragon opened this issue 3 years ago • 3 comments

ref: https://github.com/JuliaLang/julia/issues/24741

Generated using the following code with manual modifications

  • Sort by type size
  • Move AbstractIrrational to the end
using AbstractTrees
AbstractTrees.children(x::Type) = subtypes(x)
print_tree(Number)

preview image

inkydragon avatar Jul 09 '22 09:07 inkydragon

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?

fredrikekre avatar Jul 09 '22 11:07 fredrikekre

Any more comments?

inkydragon avatar Aug 01 '22 12:08 inkydragon

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

mkitti avatar Aug 04 '22 19:08 mkitti