title: Haskell partial function application with $
body: <p>I'm new to Haskell and looking at a simple example of using function application with <code>$</code>.</p>
  
  <p>It seems straightforward - it takes a function and applies it to a value.</p>
  
  <p>So this makes sense:</p>
  
  <pre><code>&gt; (+3) $ 2
  5
  </code></pre>
  
  <p>This also makes sense:</p>
  
  <pre><code>&gt; ($) (+3) 2
  5
  </code></pre>
  
  <p>This makes sense because the first argument is the function, and the second argument is the value.</p>
  
  <p>Now considering using <code>$</code> to create a partial function.</p>
  
  <p>Looking at types, this makes sense - it just needs a <code>Num</code> type value for <code>b</code>:</p>
  
  <pre><code>&gt; :t ($) (+3)
  ($) (+3) :: Num b =&gt; b -&gt; b
  </code></pre>
  
  <p>But here's where I get lost - what is happening here?:</p>
  
  <pre><code>&gt; :t ($) (2)
  ($) (2) :: Num (a -&gt; b) =&gt; a -&gt; b
  </code></pre>
  
  <p>I would have expected the first argument would need to be a function, not a simple Num value.</p>
  
  <p>So here's my questions:</p>
  
  <ol>
  <li>What's happening here?</li>
  <li>What does the constraint <code>Num (a -&gt; b)</code> syntax mean?</li>
  <li>What's an example of using <code>($)</code> in this way, that starts with something like <code>($) (2)</code>?</li>
  </ol>
  
  <p>Thanks!</p>