Suppose I have
abstract Foo{T}
immutable Foo1{T} <:Foo{T} end
immutable Foo2{T} <:Foo{T} end
How can I write a function that returns T given the type? E.g.: I want to
do
Base.eltype(::Type{Foo{T}})=T
But this won't work for eltype(Foo1{T})
Suppose I have
abstract Foo{T}
immutable Foo1{T} <:Foo{T} end
immutable Foo2{T} <:Foo{T} end
How can I write a function that returns T given the type? E.g.: I want to
do
Base.eltype(::Type{Foo{T}})=T
But this won't work for eltype(Foo1{T})