-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
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 Unions with appropriate typealiases. For example:
julia> methods(permutedims)
#2 methods for generic function "permutedims":
permutedims(B::Union{Base.ReshapedArray{T<:Any,N<:Any,A<:DenseArray,MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N<:Any}}},DenseArray{T<:Any,N<:Any},SubArray{T<:Any,N<:Any,A<:Union{Base.ReshapedArray{T<:Any,N<:Any,A<:DenseArray,MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N<:Any}}},DenseArray},I<:Tuple{Vararg{Union{Base.AbstractCartesianIndex,Colon,Int64,Range{Int64}},N<:Any}},L<:Any}}, perm) at multidimensional.jl:959
permutedims{T,N}(A::AbstractArray{T,N}, perm) at permuteddimsarray.jl:47But the first method is actually defined as permutedims(B::StridedArray, perm) which is rather simpler to read.
This is easy to point out, but actually implementing it seems likely to be hard starting from the jl_uniontype_t itself. Unless Union types get modified to record whether they come from a typealias.
mauro3
Metadata
Metadata
Assignees
Labels
No labels