title: Haskell: problems fully defining factorial in Continuation Passing Style
body: <p>I've been trying to understad Functional Programming, Haskell and Continuation Passing Style in one big blob and my structured/OOP background is giving me a hard time.</p>
  
  <p>According to <a href="http://www.haskell.org/haskellwiki/Continuation" rel="nofollow">this</a> I understand the following should be a correct definition of factorial in CPS-style:</p>
  
  <pre><code>factorial n = fact n id where id = \x -&gt; x
      fact 0 cont = cont n
      fact (n+1) cont = fact n * (n + 1)
  </code></pre>
  
  <p>but I'm not sure about the "* (n + 1)" part at the end - is that correct?</p>