/ Haskell /

记录详情

Compile Error

[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)
正在同步测试数据,请稍后

信息

递交者
类型
递交
题目
P1000 a+b
语言
Haskell
递交时间
2020-07-21 17:17:31
评测时间
2020-07-21 17:17:31
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes