<p dir="auto">There's now a number of issues open for thoughts about how to make the printing of types more readable. Here's another notion: it would be nice if printing could replace <code class="notranslate">Union</code>s with appropriate typealiases. For example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; methods(permutedims)
#2 methods for generic function &quot;permutedims&quot;:
permutedims(B::Union{Base.ReshapedArray{T&lt;:Any,N&lt;:Any,A&lt;:DenseArray,MI&lt;:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N&lt;:Any}}},DenseArray{T&lt;:Any,N&lt;:Any},SubArray{T&lt;:Any,N&lt;:Any,A&lt;:Union{Base.ReshapedArray{T&lt;:Any,N&lt;:Any,A&lt;:DenseArray,MI&lt;:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N&lt;:Any}}},DenseArray},I&lt;:Tuple{Vararg{Union{Base.AbstractCartesianIndex,Colon,Int64,Range{Int64}},N&lt;:Any}},L&lt;:Any}}, perm) at multidimensional.jl:959
permutedims{T,N}(A::AbstractArray{T,N}, perm) at permuteddimsarray.jl:47"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(permutedims)
<span class="pl-c"><span class="pl-c">#</span>2 methods for generic function "permutedims":</span>
<span class="pl-c1">permutedims</span>(B<span class="pl-k">::</span><span class="pl-c1">Union</span>{Base<span class="pl-k">.</span>ReshapedArray{T<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,N<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray</span>,MI<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N&lt;:Any}}</span>},DenseArray{T<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,N<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>},SubArray{T<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,N<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">Union</span>{Base<span class="pl-k">.</span>ReshapedArray{T<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,N<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray</span>,MI<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N&lt;:Any}}</span>},DenseArray},I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Base<span class="pl-k">.</span>AbstractCartesianIndex,Colon,Int64,Range{Int64}},N<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}},L<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}, perm) at multidimensional<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">959</span>
<span class="pl-c1">permutedims</span><span class="pl-c1">{T,N}</span>(A<span class="pl-k">::</span><span class="pl-c1">AbstractArray{T,N}</span>, perm) at permuteddimsarray<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">47</span></pre></div>
<p dir="auto">But the first method is actually defined as <code class="notranslate">permutedims(B::StridedArray, perm)</code> which is rather simpler to read.</p>
<p dir="auto">This is easy to point out, but actually implementing it seems likely to be hard starting from the <code class="notranslate">jl_uniontype_t</code> itself. Unless <code class="notranslate">Union</code> types get modified to record whether they come from a <code class="notranslate">typealias</code>.</p>
<p dir="auto">I'd like to request some speculative brain cells spent on how we print method signatures to the REPL.</p>
<p dir="auto">Currently, we expand out all typealiases. While this policy has the advantage of producing unambiguous output, the composition of type aliases through type parameters leads to combinatorially long string representations.</p>
<p dir="auto">A particularly egregious example in Base is <code class="notranslate">eigfact!</code>:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; methods(eigfact!)

#12 methods for generic function &quot;eigfact!&quot;:

...

eigfact!{T&lt;:Union{Complex{Float32},Complex{Float64}}}(A::Union{DenseArray{T,2},SubArray{T,2,A&lt;:DenseArray{T&lt;:Any,N&lt;:Any},I&lt;:Tuple{Vararg{Union{Colon,Int64,Range{Int64}}}},LD&lt;:Any}}) at linalg/eigen.jl:50

eigfact!{T&lt;:Union{Float32,Float64}}(A::Union{DenseArray{T,2},SubArray{T,2,A&lt;:DenseArray{T&lt;:Any,N&lt;:Any},I&lt;:Tuple{Vararg{Union{Colon,Int64,Range{Int64}}}},LD&lt;:Any}}, B::Union{DenseArray{T,2},SubArray{T,2,A&lt;:DenseArray{T&lt;:Any,N&lt;:Any},I&lt;:Tuple{Vararg{Union{Colon,Int64,Range{Int64}}}},LD&lt;:Any}}) at linalg/eigen.jl:121

eigfact!{T&lt;:Union{Complex{Float32},Complex{Float64}}}(A::Union{DenseArray{T,2},SubArray{T,2,A&lt;:DenseArray{T&lt;:Any,N&lt;:Any},I&lt;:Tuple{Vararg{Union{Colon,Int64,Range{Int64}}}},LD&lt;:Any}}, B::Union{DenseArray{T,2},SubArray{T,2,A&lt;:DenseArray{T&lt;:Any,N&lt;:Any},I&lt;:Tuple{Vararg{Union{Colon,Int64,Range{Int64}}}},LD&lt;:Any}}) at linalg/eigen.jl:142

..."><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">methods</span>(eigfact!)

<span class="pl-c"><span class="pl-c">#</span>12 methods for generic function "eigfact!":</span>

<span class="pl-k">...</span>

<span class="pl-c1">eigfact!</span><span class="pl-c1">{T&lt;:Union{Complex{Float32},Complex{Float64}}}</span>(A<span class="pl-k">::</span><span class="pl-c1">Union</span>{DenseArray{T,<span class="pl-c1">2</span>},SubArray{T,<span class="pl-c1">2</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray{T&lt;:Any,N&lt;:Any}</span>,I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Colon,Int64,Range{Int64}}}},LD<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}) at linalg<span class="pl-k">/</span>eigen<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">50</span>

<span class="pl-c1">eigfact!</span><span class="pl-c1">{T&lt;:Union{Float32,Float64}}</span>(A<span class="pl-k">::</span><span class="pl-c1">Union</span>{DenseArray{T,<span class="pl-c1">2</span>},SubArray{T,<span class="pl-c1">2</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray{T&lt;:Any,N&lt;:Any}</span>,I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Colon,Int64,Range{Int64}}}},LD<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}, B<span class="pl-k">::</span><span class="pl-c1">Union</span>{DenseArray{T,<span class="pl-c1">2</span>},SubArray{T,<span class="pl-c1">2</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray{T&lt;:Any,N&lt;:Any}</span>,I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Colon,Int64,Range{Int64}}}},LD<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}) at linalg<span class="pl-k">/</span>eigen<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">121</span>

<span class="pl-c1">eigfact!</span><span class="pl-c1">{T&lt;:Union{Complex{Float32},Complex{Float64}}}</span>(A<span class="pl-k">::</span><span class="pl-c1">Union</span>{DenseArray{T,<span class="pl-c1">2</span>},SubArray{T,<span class="pl-c1">2</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray{T&lt;:Any,N&lt;:Any}</span>,I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Colon,Int64,Range{Int64}}}},LD<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}, B<span class="pl-k">::</span><span class="pl-c1">Union</span>{DenseArray{T,<span class="pl-c1">2</span>},SubArray{T,<span class="pl-c1">2</span>,A<span class="pl-k">&lt;:</span><span class="pl-c1">DenseArray{T&lt;:Any,N&lt;:Any}</span>,I<span class="pl-k">&lt;:</span><span class="pl-c1">Tuple</span>{Vararg{Union{Colon,Int64,Range{Int64}}}},LD<span class="pl-k">&lt;:</span><span class="pl-c1">Any</span>}}) at linalg<span class="pl-k">/</span>eigen<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">142</span>

<span class="pl-k">...</span></pre></div>
<p dir="auto">I estimate that only three people in the world can read the first method signature and immediately recognize that the original calling signature was</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="eigfact!{T&lt;:BlasComplex}(A::StridedMatrix{T})"><pre class="notranslate"><code class="notranslate">eigfact!{T&lt;:BlasComplex}(A::StridedMatrix{T})
</code></pre></div>
<p dir="auto">and it would take an eagle eye to realize that the first method takes one argument whereas the other two take two inputs each.</p>
<p dir="auto">It would be much nicer to print something like the original method signature instead of feeling overwhelmed by C++ expression template-like verbal diarrhea. It's clear, though, that the additional bookkeeping of typealiases and matching of typealiases to method signatures is a hard problem.</p>