Function not accepting other atoms as arguments?

Why is this function is not accepting other atoms as arguments, only :a,:b,:c:,d:?

list_contact = fn ([:a,:b],[:c,:d]) -> [:a, :b] ++ [:c,:d] end

It’s pattern matching on [:a,:b],[:c,:d]
If you want it to accept any list you should write it like this

list_concat = fn(list1, list2) -> list1 ++ list2 end
3 Likes