dYT*_*YTe 0 haskell integer average
我正在尝试创建一个函数,它将给定列表中的所有数字相加,然后将其除以6.
average :: [Integer] -> Integer
average m = (sum m) quot 6
Run Code Online (Sandbox Code Playgroud)
但这是我收到的错误消息:
Couldn't match type `Integer'
with `(a0 -> a0 -> a0) -> a1 -> Integer'
Expected type: [(a0 -> a0 -> a0) -> a1 -> Integer]
Actual type: [Integer]
In the first argument of `sum', namely `m'
In the expression: (sum m) quot 6
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
81 次 |
| 最近记录: |