Is it only tuples that you want to consider as “composite”, would e.g.
contains_any(Array{Any,2}) or contains_any(Union{Integer,Any}) also return
true?
Also, all use cases I can think of for this function indicate that you
could just as well use isleaftype directly, so you might not need to figure
this out at all :)
// T
On Monday, September 21, 2015 at 5:13:02 AM UTC+2, Tommy Hofmann wrote:
I would like to write a function "contains_any(T)" which checks wether a
> type T "contains" Any. For example
>
> contains_any(Integer) = false
> contains_any(Any) = true
> contains_any(Tuple{Integer, Any}) = true
> contains_any(Tuple{Tuple{Integer, Any}, Float64}) = true
>
> etc. How could one do this in julia?
>
> Thanks,
> Tommy
>