title: How does applicative sequencing over a list of functions work?
body: <p>I'm learning Haskell with the <a href="http://learnyouahaskell.com/" rel="noreferrer" title="Learn You a Haskell">Learn You a Haskell</a> guide, and I'm stuck on an example of applicative sequencing over a list of functions. <a href="http://learnyouahaskell.com/functors-applicative-functors-and-monoids" rel="noreferrer" title="Functors, Applicative Functors and Monoids">Chapter 11: Functors, Applicative Functors and Monoids</a> defines sequenceA to be:</p>
  
  <pre><code>sequenceA :: (Applicative f) =&gt; [f a] -&gt; f [a]
  sequenceA [] = pure []
  sequenceA (x:xs) = (:) &lt;$&gt; x &lt;*&gt; sequenceA xs
  </code></pre>
  
  <p>I'm a bit confounded by this example usage of sequenceA:</p>
  
  <pre><code>&gt; sequenceA [(+3),(+2),(+1)] 3
  [6,5,4]
  </code></pre>
  
  <p>I've expanded the application manually as far as I could to what I believe is correct:</p>
  
  <pre><code>(:) &lt;$&gt; (+3) &lt;*&gt; sequenceA [(+2), (+1)]
  (:) &lt;$&gt; (+3) &lt;*&gt; (:) &lt;$&gt; (+2) &lt;*&gt; (:) &lt;$&gt; (+1) &lt;*&gt; sequenceA []
  (:) &lt;$&gt; (+3) &lt;*&gt; (:) &lt;$&gt; (+2) &lt;*&gt; (:) &lt;$&gt; (+1) &lt;*&gt; pure []
  (:) &lt;$&gt; (+3) &lt;*&gt; (:) &lt;$&gt; (+2) &lt;*&gt; (:) &lt;$&gt; (+1) &lt;*&gt; const []
  </code></pre>
  
  <p>What I don't see though, is how the second argument to the original application of sequenceA, <code>3</code> gets applied to each of the partially applied functions given in the list. I would appreciate some assistance in trying to wrap my head around what goes on in the evaluation of this statement.</p>