sum' :: Int -> Int sum' n = foldr (\acc item -> acc + item) 0 [1..n] main :: IO () main = do n <- readLn :: IO Int putStrLn $ show $ sum' n