As long as you don't mind preserving exactly what's between the {},
(t.parameters...)
is an easy way to get this.
--Tim
On Sunday, July 24, 2016 5:21:56 AM CDT Kristoffer Carlsson wrote:
> Maybe;
>
> type MyType end
>
> function f(t::DataType)
> I = ()
> for t in t.types
> if isa(t, TypeVar)
> I = (I..., Any)
> else
> I = (I..., t)
> end
> end
> return I
> end
>
> julia> f(Tuple{Int64, Float64})
> (Int64,Float64)
>
> julia> f(Tuple{Int64, MyType, Float32})
> (Int64,MyType,Float32)
>
> julia> f(NTuple{3})
> (Any,Any,Any)
>
> julia> f(Tuple)
> (Vararg{Any,N},julia> f(Tuple{Int64, Float64})
> (Int64,Float64)
>
> Probably has crappy performance though.