title: Haskell: cannot construct the infinite type: t ~ t -> t
body: <p>I wrote a function, which calculates catalan numbers, but it doesn't compile. I receive this error message:</p>
  
  <blockquote>
    <p><code>• Occurs check: cannot construct the infinite type: t ~ t -&gt; t
    Relevant bindings include
    catalanNum :: t (bound at CatNum.hs:1:1)</code></p>
  </blockquote>
  
  <p>And here is my code:</p>
  
  <pre><code>catalanNum 0 = 1
  catalanNum n =  div(2 *(catalanNum * (n-1)) * (2 * (n-1) + 1))(n + 1)
  </code></pre>
  
  <p>How can I eliminate this error?</p>