You can also pattern match on Elixir Data Structures such as Lists.
Lists
Matching on a list is quite simple.
[head | tail] = [1,2,3,4,5]
# head == 1
# tail == [2,3,4,5]
This works by matching the first (or more) elements in the list to the left hand side of the | (pipe) and the rest of the ...