title: Accessing intermediate results in elixir
body: <p>I have the following code and I think one would like to use pipes, but I cant figure out how - I have tried a ton of different approaches, but it appears I am missing a key understanding how piping works. Anyways: The following code does what I want it to:</p>
  <p>project has_many budget_itens/work_items</p>
  <pre><code>def show(conn, %{&quot;id&quot; =&gt; id}) do
      project = Clients.get_project!(id)
      project = Map.put_new(project, :budget, total_budget(project.budget_items))
      project = Map.put_new(project, :budget_used, budget_used(project.work_items))
      project = Map.put_new(project, :budget_remaining, project.budget - project.budget_used)
  
      changeset = Clients.change_budget_item(%BudgetItem{project_id: project.id})
      render(conn, &quot;show.html&quot;, project: project, changeset: changeset)
    end
  </code></pre>
  <p>Any help?</p>