title: How much space is required in my SML code?
body: <p>I have SML code like below.</p>
  
  <pre><code>fun fact(n) =
      let fun f(n,g) = if n=0 then g(1)
                       else f(n-1, fn x=&gt;g(x)*n)
  in f(n, fn x=&gt; x) end;
  </code></pre>
  
  <p>I want to know how much space is required in my code for computing fact(n).
  Is it right it requires O(n)? I don't know exactly.</p>