Write a function which repeatedly calculates the least signifigant digit and adds it to a return value, then divide the number by 10. When the value is zero, return the reversed value. The calculation would be something like this:

ret = ( val % 10 ) + ret * 10;

-Prelude