Skip to content

Instantly share code, notes, and snippets.

@polgfred
Created April 27, 2010 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polgfred/380853 to your computer and use it in GitHub Desktop.
Save polgfred/380853 to your computer and use it in GitHub Desktop.
reverseDigits base value = pullFrom value 0
where pullFrom 0 t = t
pullFrom v t = pullFrom (div v base) ((t * base) + (mod v base))
@polgfred
Copy link
Author

Recursion just looks so beautiful in Haskell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment