Skip to content

Instantly share code, notes, and snippets.

@rbe
Created January 20, 2011 15:20
Show Gist options
  • Save rbe/788042 to your computer and use it in GitHub Desktop.
Save rbe/788042 to your computer and use it in GitHub Desktop.
Convert a list of integers into a single integer
-- Convert list of integer to one integer: [1,2,3,4] to 1234.
intListToInt :: [Integer] -> Integer
intListToInt = foldl (\a x -> x + a * 10) 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment