Extract type name only from parametric type

Do you mean this?

help?> Core.TypeName
  No documentation found.

  Summary
  ≡≡≡≡≡≡≡≡≡

  mutable struct Core.TypeName <: Any

  Fields
  ≡≡≡≡≡≡≡≡

  name        :: Symbol
  module      :: Module
  names       :: Core.SimpleVector
  wrapper     :: Type
  cache       :: Core.SimpleVector
  linearcache :: Core.SimpleVector
  hash        :: Int64
  mt          :: Any

julia> Base.typename(Vector{Int})
Array

julia> typeof(ans)
Core.TypeName

julia> Base.typename(Vector{Int}).wrapper
Array

julia> typeof(ans) 
UnionAll 

Core.TypeName.wrapper seems to be what you want.

3 Likes