title: Reading a scala function
body: <p>I was reading <a href="https://jaceklaskowski.gitbooks.io/mastering-apache-spark/content/spark-sql-udfs.html" rel="nofollow noreferrer">this page</a>, and I came across this function definition in scala:</p>
  
  <pre><code>def upper: String =&gt; String = _.toUpperCase
  </code></pre>
  
  <p>After trying it out, it seems that it works the same as this:</p>
  
  <pre><code>def upper = (str: String) =&gt; str.toUpperCase()
  </code></pre>
  
  <p>Are both functions the same? If so, how do I read the above function (first one)? does this way of defining definitions have a specific name?</p>