title: Understanding pattern matching in Elixir function parameters
body: <p> In the book 'Elixir in Action', one of the examples has a function that is tripping up my understanding of pattern matching:</p>
  
  <pre class="lang-elixir prettyprint-override"><code>def add_entry(
      %TodoList{entries: entries, auto_id: auto_id} = todo_list,
      entry
    ) do
      entry = Map.put(entry, :id, auto_id)
      new_entries = HashDict.put(entries, auto_id, entry)
  
      %TodoList{todo_list |
        entries: new_entries,
        auto_id: auto_id + 1
      }
   end
  </code></pre>
  
  <p>The first parameter, <code>%TodoList{entries: entries, auto_id: auto_id} = todo_list</code>, the book explains "...Furthermore, you keep the entire instance in a <code>todo_list</code> variable"</p>
  
  <p>This confuses me because I thought variables get bound on the left side of a '=' pattern matching operator. Could someone help explain what is happening with the first parameter and how the incoming values are able to be used inside the function body?</p>