title: Haskell reverse Integer with recursion
body: <p>I want to reverse an Integer in Haskell with recursion. I have a small issue.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>reverseInt :: Integer -&gt; Integer
  reverseInt n
  |  n&gt;0 = (mod n 10)*10 + reverseInt(div n 10)
  |  otherwise = 0
  </code></pre>
  
  <blockquote>
    <p>Example 345</p>
  </blockquote>
  
  <p>I use as input 345 and I want to output 543</p>
  
  <p>In my program it will do....</p>
  
  <pre><code>reverseInt 345
  345&gt;0
  mod 345 10 -&gt; 5
  reverseInt 34
  34
  34&gt;0
  mod 34 10 -&gt; 4
  reverseInt 3
  3&gt;0
  mod 3 10 -&gt; 3
  reverseInt 0
  0=0 (ends)
  </code></pre>
  
  <p>And at the end it returns the sum of them... 5+4+3 = 12.</p>
  
  <p>So I want each time before it sums them, to multiple the sum * 10. So it will go...</p>
  
  <pre><code>5
  5*10 + 4
  54*10 + 3
  543
  </code></pre>