Created
April 27, 2010 15:15
-
-
Save polgfred/380853 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reverseDigits base value = pullFrom value 0 | |
where pullFrom 0 t = t | |
pullFrom v t = pullFrom (div v base) ((t * base) + (mod v base)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recursion just looks so beautiful in Haskell.