title: Couldn't match expected type ‘[Char]’ with actual type ‘Int’
body: <p>Working on a method to convert a number n into any base b and having some trouble.</p>
  
  <p>Code:</p>
  
  <pre><code>int2Base :: Int -&gt; Int -&gt; String
  int2Base n b
      |n == 0 = "0"
      |otherwise = (mod n b) ++ int2Base (div n b) b
  </code></pre>
  
  <p>and my error:</p>
  
  <pre><code>Couldn't match expected type ‘[Char]’ with actual type ‘Int’
  In the second argument of ‘mod’, namely ‘b’
  In the first argument of ‘(++)’, namely ‘(mod n b)’
  </code></pre>
  
  <p>It seems like a simply error but even when I cast it to a char it still expects '[Char]' not [Char]</p>