Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stevestreza/53837 to your computer and use it in GitHub Desktop.
Save stevestreza/53837 to your computer and use it in GitHub Desktop.
numberToList :: Integer -> [Integer]
numberToList x
| x == 0 = []
| x < 10 = [x]
| otherwise = (numberToList left) ++ (numberToList right)
where left = x `div` 10
right = x `mod` 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment