title: Can I nest anonymous functions in Elixir?
body: <p>I am passing a function to <code>Enum.reduce</code> as follows to get <code>24</code></p>
  
  <pre><code>Enum.reduce([1,2,3,4], &amp;(&amp;1 * &amp;2)) #=&gt; 24
  </code></pre>
  
  <p>If I have a nested list in which I would like to multiply each nested element and sum them together. For example in <code>[[1,2],[3,4]]</code> I would like to perform <code>[[1*2] + [3*4]]</code> to get <code>14</code>, is there a way to do it (using anonymous functions)</p>
  
  <p>This is what I tried (knowing its incorrect) and I got <code>nested captures via &amp; are not allowed</code>. I am trying to understand the required mental model when using Elixir</p>
  
  <pre><code>Enum.reduce([[1,2],[3,4]], &amp;(&amp;(&amp;1 * &amp;2) + &amp;(&amp;1 * &amp;2)))
  </code></pre>