Project Euler: Problem40
import Data.Char main = print $ summation 1 $ concatMap show [1..] summation n (x:xs) = case n of 1 -> digitToInt x * summation (n+1) xs 10 -> digitToInt x * summation (n+1) xs 100 -> digitToInt x * summation (n+1) xs 1000 -> digitToInt x * summation (n+1) xs 10000 -> digitToInt x * summation (n+1) xs 100000 -> digitToInt x _ -> summation (n+1) xs