Joining list and tuple?

That works for any term:

iex> [] ++ 3
3

iex> [] ++ "foo"
"foo"

The return value is an improper list. As you can read in the documentation, when the right-hand side of this function (++/2) is not a list, the return value is an improper list. (Point being, a tuple is not a list).

5 Likes