title: SML: how are constructors and functions distinguished?
body: <p>I have the following two "functions": is_three and SOME</p>
  
  <pre><code>fun is_three(number) =
      case numbers of
          3 =&gt; true
         | _ =&gt; false
  </code></pre>
  
  <p>When I write in the following two statements I get this:</p>
  
  <pre><code>is_three; 
  val it = fn : int -&gt; bool
  SOME;
  val it = fn : 'a -&gt; 'a option
  </code></pre>
  
  <p>from the surface they both seem to be functions which return values. However if i try using is_three in a case statement I get the following:</p>
  
  <pre><code>stdIn:20.9-20.19 Error: non-constructor applied to argument in pattern: is_three
  
   fun are_threes(numbers) =
       case numbers of
           [] =&gt; true
         | is_three(x)::xs =&gt; true andalso are_threes(xs)
  </code></pre>
  
  <ol>
  <li>how can the case statement distinguish whats a constructor and whats a function</li>
  <li>Why are functions not allowed in case statements?</li>
  </ol>