title: how to split a list into two lists in which the first has the positive entries and the second has non-positive entries-SML
body: <p>I am a new to SML and I want to write a function splitup : <code>int list -&gt; int list * int list</code> that given a list of integers creates from two lists of integers, one containing the non-negative entries, the other containing the negative entries.
  Here is my code :</p>
  
  <pre><code>fun splitup (xs :int list) =
    if null xs
    then ([],[])
    else if hd xs &lt; 0
    then hd xs :: #1 splitup( tl xs)
    else hd xs :: #2 splitup( tl xs)
  </code></pre>
  
  <p>Here's the warning i get:</p>
  
  <pre><code>ERROR : operator and operand don't agree
  ERROR : types of if branches do not agree
  </code></pre>
  
  <p>The function <strong><em>splitup(tl xs)</em></strong> should return <code>int list * int list</code> so i think my recursion should be all right.
  What is the problem and how can i fix it ?</p>