title: Finding the Maximum element in a list with pattern matching and recursion F#
body: <p>I'm trying to find the maximum element in a list without using List.Max for a school assignment using the below given template. </p>
  
  <pre><code>        let findMax l = 
          let rec helper(l,m) = failwith "Not implemented"
  
          match l with
          | [] -&gt; failwith "Error -- empty list"
          | (x::xs) -&gt; helper(xs,x) 
  </code></pre>
  
  <p>The only solution to the problem I can think of, atm is </p>
  
  <pre><code>        let rec max_value1 l =
            match l with
            |[] -&gt; failwith "Empty List"
            |[x] -&gt; x
            |(x::y::xs) -&gt;  if x&lt;y then max_value1 (y::xs)
                  else max_value1 (x::xs)
  
          max_value1 [1; 17; 3; 6; 1; 8; 3; 11; 6; 5; 9];;    
  </code></pre>
  
  <p>Is there any way I can go from the function I built to one that uses the template? Thanks!</p>