title: how lambda works with reduce
body: <p>I was trying to understand how <code>reduce</code> works through this website. The example they have mentioned is quite good and easy to understand.</p>
  
  <p><a href="http://book.pythontips.com/en/latest/map_filter.html#reduce" rel="nofollow noreferrer">http://book.pythontips.com/en/latest/map_filter.html#reduce</a></p>
  
  <pre><code>a = reduce((lambda x, y: x * y), [1, 2, 3, 4])
  </code></pre>
  
  <p>The above function will multiple each and every number in list and assign to <code>a</code>. </p>
  
  <p>However, I got totally stumped when I came across following function in project. </p>
  
  <pre><code>def compose(*fns):
      return reduce(lambda acc, fn: lambda *args: acc(fn(*args)), fns, lambda _: _)
  </code></pre>
  
  <p>could someone help me breakdown this function to understand what it's suppose to do</p>