title: Haskell: Understanding the map function when used with lambda function
body: <p>I have the following two Haskell expressions:</p>
  
  <pre><code>map (\f x -&gt; f x 5) [(-),(+),(*)]
  map (\f x -&gt; f 5 x) [(-),(+),(*)]
  </code></pre>
  
  <p>And I'm trying to figure out whether either expression above is equivalent to the following expression:</p>
  
  <pre><code>map ($ 5) [(-),(+),(*)]
  </code></pre>
  
  <p>I am trying to understand what the difference between the first two expressions is.
  Since for both expressions, there is only one parameter passed to the lambda function (e.g. the operator), the function will be partially applied. </p>
  
  <p>Is it correct to say that the elements in the result list from the first expression will be:</p>
  
  <p>(1) <code>- x 5 = (- x) 5</code></p>
  
  <p>(2) <code>+ x 5 = (+ x) 5</code></p>
  
  <p>(3) <code>* x 5 = (* x) 5</code></p>
  
  <p>And for the second expression:</p>
  
  <p>(1) <code>- 5 x = (- 5) x</code></p>
  
  <p>(2) <code>+ 5 x = (+ 5) x</code></p>
  
  <p>(3) <code>* 5 x = (* 5) x</code></p>
  
  <p>However, I don't think that either expression is equivalent to <code>map ($ 5) [(-),(+),(*)]</code>. This is because <code>(- x) 5</code> (where x is a number) gives an error in GHCI and is an invalid expression. Similarly <code>(- 5) x</code> also gives an error. 
  On the other hand, map ($5) [(-)], results in a function that takes a number and subtracts it from 5. 
  Is this reasoning correct? Any insights are appreciated.</p>