title: How to access the parameter passed through pipe operator in Elixir?
body: <p>I have a series of transformation on <code>Plug.Conn</code> that requires access to intermediary results.</p>
  
  <pre><code>n_conn = 
    conn
    |&gt; Plug.Conn.fetch_query_params()
  nn_conn =
    n_conn
    |&gt; assign(:result, inspect(Timestamp.convert_datetime(n_conn.params)))
  nn_conn
  |&gt; send_resp(200, nn_conn.assigns.result)
  |&gt; halt()
  </code></pre>
  
  <p>I need <code>n_conn</code> because <code>conn.params</code> is not set until <code>Plug.Conn.fetch_query_params()</code> is called. Likewise, I need <code>nn_conn</code> because <code>n_conn.assigns.result</code> is not set until <code>assign/3</code> function is called.</p>
  
  <p>The code is fairly ugly. If there were a way to refer to the output of pipe operator, I could simplify it like the following. I was hoping for <code>&amp;1</code> to work but it doesn't.</p>
  
  <pre><code>conn
  |&gt; Plug.Conn.fetch_query_params()
  |&gt; assign(:result, inspect(Timestamp.convert_datetime(&amp;1.params)))
  |&gt; send_resp(200, &amp;1.assigns.result)
  |&gt; halt()
  </code></pre>
  
  <p>Is there a way to deal with this?</p>