title: Converting C# code to F# (if statement)
body: <p>I'd like to know how to convert this code <strong>line by line</strong> from C# to F#. I am not looking to use any kind of F#'s idioms or something of the like. I am trying to understand how to <strong>map directly</strong> C#'s constructs to F#.</p>
  
  <p>Here is the C# code:</p>
  
  <pre><code>//requires l.Length &gt; 0
  int GetMinimumValue(List&lt;int&gt; l) {
      int minVal = l[0];
  
      for (int i = 0; i &lt; l.Length; ++i) {
          if (l[i] &gt; minValue) {
              minVal = l[i];
          }
      }
  
      return minVal;
  }
  </code></pre>
  
  <p>And here is my F# attempt:</p>
  
  <pre><code>let getMinValue (l : int list) =
      let minVal = l.Head
  
      for i = 0 to (l.Length-1) do
          if (l.Item(i) &gt; minVal) then
              minVal = col.Item(i)
  
      minVal
  </code></pre>
  
  <p>Now, this ain't working. The problem seems to be related with the <code>minVal = col.Item(i)</code> line:</p>
  
  <pre><code>This expression was expected to have type     unit     but here has type     bool
  </code></pre>
  
  <p>What is the problem, really?</p>