title: What are the options SOME and NONE in SML?
body: <p>I am new to SML (and programming, actually).</p>
  
  <pre><code>fun readlist (infile : string) =  
  
    let
    val 
        ins = TextIO.openIn infile 
  
        fun loop ins = 
  
        case TextIO.inputLine ins of 
  
        SOME line =&gt; line :: loop ins 
  
      | NONE      =&gt; [] 
  
    in 
  
       loop ins before TextIO.closeIn ins 
  
    end ;
  </code></pre>
  
  <p>This is a program I encountered here. How do I use SOME and NONE, and how to use 'before'?</p>