Something like this probably:
def foo([]), do: :empty
def foo([h|t]) when is_binary(h), do: :list_of_strings
def foo([h|t]) when is_number(h), do: :list_of_numbers
def foo(tuple) when is_tuple(tuple) do
# Convert tuple to list of stuff, then recursively call foo
tuple |> tuple_to_list |> foo
end
The last clause assumes you don't care about getting a tuple back from foo
.