title: Haskell Instance of Num [Char] required for definition of getPara error
body: <pre><code>getPara :: (Num [Char])  =&gt;  [Char] -&gt; Integer -&gt; [Char]
  getPara "" _ = ""
  
  
  getPara str nr 
      | (nr == 0 ) &amp;&amp; ((head str) == ')' ) = ')' : getPara "" 0 
      | ( nr == 0 ) &amp;&amp; ( (head str) == '(' ) = '(' : (getPara (tail str) 0)
      | (nr /= 0 ) &amp;&amp; ( (head str) == '(') = (getPara (tail str) nr-1) 
      | (nr == 0 ) &amp;&amp; ( (head str) /= '(' ) = (head str) : (getPara (tail str) 0 )
      | otherwise = (getPara (tail str) nr)
  </code></pre>
  
  <p>What I am trying to do is to get from a String the nr set of brackets and the error I get is: </p>
  
  <pre><code>Illegal Haskell 98 class constraint in type declaration
  *** Expression : getPara
  *** Type       : Num [Char] =&gt; [Char] -&gt; Integer -&gt; [Char]
  </code></pre>
  
  <p>What is the problem?</p>