title: Find max value in a list recursively in scala
body: <p>I'm new to Scala, there is a better way to express this with the most basic knowledge possible? </p>
  
  <pre><code> def findMax(xs: List[Int]): Int = {
        xs match {
          case x :: tail =&gt; (if (tail.length==0) x else (if(x&gt;findMax(tail)) x else (findMax(tail))))
        }
      }
  </code></pre>