[1 of 1] Compiling Main ( foo.hs, /tmp/Main.o )
foo.hs:1:1:
Couldn't match expected type `IO t1' with actual type `[()]'
In the expression: main
When checking the type of the IO action `main'
foo.hs:2:12:
Couldn't match type `[b0]' with `Int'
Expected type: [String] -> Int
Actual type: [String] -> [b0]
In the first argument of `(.)', namely `map read'
In the first argument of `fmap', namely `(map read . words)'
foo.hs:2:37:
Couldn't match type `IO' with `[]'
Expected type: [String]
Actual type: IO String
In the second argument of `fmap', namely `getLine'
In a stmt of a 'do' block:
li <- (map read . words) `fmap` getLine :: [Int]
foo.hs:3:5:
Couldn't match type `IO' with `[]'
Expected type: [()]
Actual type: IO ()
In a stmt of a 'do' block: putStrLn $ sum li
In the expression:
do { li <- (map read . words) `fmap` getLine :: [Int];
putStrLn $ sum li }
In an equation for `main':
main
= do { li <- (map read . words) `fmap` getLine :: [Int];
putStrLn $ sum li }
foo.hs:3:20:
Couldn't match expected type `t0 String' with actual type `Int'
In the first argument of `sum', namely `li'
In the second argument of `($)', namely `sum li'
自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)