her.esy.fun/src/posts/0010-Haskell-Now/io_sum.hs
Yann Esposito (Yogsototh) cc7ee03907
wip
2019-12-25 22:17:22 +01:00

8 lines
190 B
Haskell

toList :: String -> [Integer]
toList input = read ("[" ++ input ++ "]")
main = do
putStrLn "Enter a list of numbers (separated by comma):"
input <- getLine
print $ sum (toList input)