title: Elixir list is not updating when passed through multiple methods
body: <pre><code>def create(conn, params) do
    conn 
      |&gt; render_json_response(bulk_convertor(params))
  end
  
  def bulk_convertor(%{"file" =&gt; %Plug.Upload{content_type: "text/csv", filename: basename, 
        path: fullpath}}) do
     list = [~w(old, new)]
     fullpath
       |&gt; read_csv(list)
       |&gt; form_response
  end
  
  def read_csv(path, list) do
    if path |&gt; File.stream! |&gt; Enum.count &lt;= 50 do
      path
        |&gt; File.stream!
        |&gt; Parser.parse_stream
        |&gt; Stream.map(fn [arg] -&gt; %{url: arg} end)
        |&gt; iterate_urls(list)
    else
      %{error: %{message: "Limit Exceeded"}}
    end
  end
  
  def iterate_urls(mapped_stream, list) do
    mapped_stream
      |&gt; Enum.each(fn(url) -&gt; url_convertor(url, list) end)
    %{response: %{message: "Request Initiated"}}
  end
  
  def url_convertor(%{url: val}, list) do
    with {:ok, %Route{} = route} &lt;- App.create_route(%{"url" =&gt; val}) do
      route
        |&gt; App.redirect_url
        |&gt; add_to_list(route, list)
    end
  end
  
  def add_to_list(new_url, %{url: original_url}, list) do
    list = List.insert_at(list, -1, ~w(#{original_url}, #{new_url}))
    list
  end
  </code></pre>
  
  <p>The list content is not updated whenever I try to print it somewhere using IO.inspect it shows the initial list.
  I am trying to update the content of the list based on the data parsed from the csv which i am parsing using the nimble_csv library of elixir.</p>
  
  <p>If I try to print the list inside </p>
  
  <blockquote>
    <p>add_to_list</p>
  </blockquote>
  
  <p>only two rows are visible the header that i added initially and last row from the CSV.</p>
  
  <p>Is there anything I am doing wrong here. </p>