title: Converting Integer into list of digits without 'mod' and 'div'
body: <p>I currently have the Haskell function below which converts an integer into a list of digits taken from the original integer. My question is thus: Is there a way to do this without using <code>mod</code> and <code>div</code>? For example, if I wanted to do the same thing with a string I could create a function utilising other functions such as head and tail etc.</p>
  
  <p>I struggled with this problem for a while before finally come to SO and finding the answer in another post. What got me asking this question is the fact that I would have never thought of using <code>mod</code> and <code>div</code> myself!</p>
  
  <pre><code>toDigits :: Integer -&gt; [Integer]
  toDigits n 
   | n &lt; 1 = []
   | otherwise = toDigits (n `div` 10) ++ [n `mod` 10]
  </code></pre>