title: I get Error: syntax error: inserting ELSE ID when compiling my SML code and I don't know why
body: <p>I am attending a Coursera class, and I am trying to do my homeworks.</p>
  
  <p>We have to write an SML program that takes a list of cards (caracterised by their suit and rank) and returns true if they all have the same color and false otherwise.</p>
  
  <p>Here is my code (i can't figure why its false, but i am quit a noob in programming):</p>
  
  <pre><code>datatype suit = Clubs | Diamonds | Hearts | Spades
  datatype rank = Jack | Queen | King | Ace | Num of int 
  type card = suit * rank
  
  datatype color = Red | Black
  datatype move = Discard of card | Draw 
  
  
  fun card_color (c) = case c of
  (Hearts,_) =&gt; Red
  |(Diamonds,_)  =&gt; Red
  |(_,_) =&gt; Black
  
  
  fun all_same_color (cs) = case cs of
      [] =&gt; false
      |x::[] =&gt; true 
  |x::y::[] =&gt;  if card_color (x) = card_color (y) then true
  |x::y::xs =&gt; if card_color(x)=card_color(y) then all_same_color(xs)
                          else false
  </code></pre>