Converting C# code to F# (if statement)
问题 I'd like to know how to convert this code line by line 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 map directly C#'s constructs to F#. Here is the C# code: //requires l.Length > 0 int GetMinimumValue(List<int> l) { int minVal = l[0]; for (int i = 0; i < l.Length; ++i) { if (l[i] > minValue) { minVal = l[i]; } } return minVal; } And here is my F# attempt: let getMinValue (l : int list) = let minVal = l.Head for i = 0