title: List manipulation in F#
body: <p>What I'm hoping to make this function do is:</p>
  
  <ol>
  <li><p>Generate a list of random integers of length specified by count</p></li>
  <li><p>Generate another random number to replace first element of list</p></li>
  <li><p>Sort the list</p></li>
  <li><p>Split list in half, discarding second half</p></li>
  <li><p>Discard first element of list</p></li>
  <li><p>Repeat 2-5 unless list is empty</p></li>
  </ol>
  
  <p>What I have so far (but not working) is below.  What is the matter with it?</p>
  
  <pre><code>let go count =
      let rec cut l = 
          if List.length l = 0 then l
          printfn "%A" l
          let list = System.Random().Next(100)::List.tail l
          let cut list = 
              let firstHalf= list |&gt; Seq.take (List.length list / 2) |&gt; Seq.toList
              firstHalf
          let listSorted = List.sort list
          cut (List.tail listSorted)
      let r = System.Random()
      let list1 = List.init count (fun numbers -&gt; r.Next(100))
      printfn "List = %A" list1
      cut list1
  </code></pre>