Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created November 12, 2009 02:48
Show Gist options
  • Save Raynes/232544 to your computer and use it in GitHub Desktop.
Save Raynes/232544 to your computer and use it in GitHub Desktop.
splitDigits :: String -> [Int]
splitDigits = map digitToInt
addNum :: Int -> Int
addNum = foldl' (+) 0 . splitDigits . show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment