title: Difference between similar curried types in Scala
body: <p>What is the difference between the types of the following two functions?</p>
  
  <pre><code>def add1: Int =&gt; Int =&gt; Int = a =&gt; b =&gt; a + b
  def add2(a: Int)(b: Int) = a + b
  </code></pre>
  
  <p>Based on their declarations, they seem to have the same type.  Both are called in the same way:</p>
  
  <pre><code>scala&gt; add1(1)(2)
  res2: Int = 3
  
  scala&gt; add2(1)(2)
  res3: Int = 3
  </code></pre>
  
  <p>However, there is an apparent difference in their types:</p>
  
  <pre><code>scala&gt; :t add1
  Int =&gt; Int =&gt; Int
  
  scala&gt; :t add2
  (a: Int)(b: Int)Int
  </code></pre>
  
  <p>Additionally, partial application of <code>add1</code> is a bit cleaner than of <code>add2</code>.</p>
  
  <pre><code>scala&gt; add1(1)
  res4: Int =&gt; Int = &lt;function1&gt;
  
  scala&gt; add2(1)(_)
  res5: Int =&gt; Int = &lt;function1&gt;
  </code></pre>