title: Trying to understand function application operator in Haskell
body: <p>I'm trying to wrap my head around the function application operator (<code>$</code>) in Haskell.</p>
  
  <p>I'm working through the examples in Learn You a Haskell, and I thought I understood the following example:</p>
  
  <pre><code>Prelude&gt; map ($ 3) [(+4), (*10), (^2), sqrt]
  [7.0,30.0,9.0,1.7320508075688772] 
  </code></pre>
  
  <p>I then tried the following variant, which also worked fine:</p>
  
  <pre><code>Prelude&gt; map ($ 3) [(+4), (*10), (\x -&gt; x^2), sqrt]
  [7.0,30.0,9.0,1.7320508075688772]
  </code></pre>
  
  <p>Finally, I tried modifying the third function in the list as follows, which generates an error:</p>
  
  <pre><code>Prelude&gt; map ($ 3) [(+4), (*10), (\x -&gt; 2^x), sqrt] 
  &lt;interactive&gt;:53:38:
      Ambiguous type variable `b0' in the constraints:
        (Floating b0)
          arising from a use of `sqrt' at &lt;interactive&gt;:53:38-41
        (Integral b0) arising from a use of `^' at &lt;interactive&gt;:53:33
        (Num b0) arising from the literal `3' at &lt;interactive&gt;:53:8
      Probable fix: add a type signature that fixes these type variable(s)
      In the expression: sqrt
      In the second argument of `map', namely
        `[(+ 4), (* 10), (\ x -&gt; 2 ^ x), sqrt]'
      In the expression: map ($ 3) [(+ 4), (* 10), (\ x -&gt; 2 ^ x), sqrt]
  Prelude&gt; 
  </code></pre>
  
  <p>It seems if the final <code>sqrt</code> function is somehow begin associated with the previous list element, as the following variant works ok:</p>
  
  <pre><code>Prelude&gt; map ($ 3) [(+4), (*10), (\x -&gt; 2^x)]
  [7,30,8]
  </code></pre>
  
  <p>Can someone enlighten me as to what's going on here? </p>