title: Compare values in a list
body: <p>Trying to conceptualize how I would compare several values in a list to find the largest value, without using mutable variables.</p>
  
  <p>For example in an imperative language I could simply store a max variable that gets updated every time the iteration finds a larger value in the list. Like such:</p>
  
  <pre><code>max = 0;
  for i in list
    if i &gt; max
      max = i
  </code></pre>
  
  <p>Now, in functional programming if i had a list, for example [1; 2; 3]
  How would I get around the issue of using a max variable?</p>