title: Scala reduce on Point class
body: <p>I cannot get the <code>Point</code> class to search for the <code>x</code> coordinate maximum with one <code>reduce</code> operation (the following I use <code>map</code> then <code>reduce</code>)</p>
  
  <pre><code>case class Point(x : Double, y : Double)
  val pts = List(Point(1,3), Point(-3,2), Point(5,3))
  
  pts.map(p =&gt; p.x).reduce( _ max _ )
  </code></pre>
  
  <p>This will return</p>
  
  <pre><code>res22: Double = 5.0
  </code></pre>
  
  <p>How to use a single reduce operation to get the max of <code>x</code> out? I tried the following, but didn't get what I expect.</p>
  
  <pre><code>pts.reduce( _.x max _.x )
  &lt;console&gt;:11: error: type mismatch;
   found   : Double
   required: Point
  </code></pre>