我是一个尝试学习haskell的新手,我试图在其他论坛中搜索类似的东西,但找不到类似的问题。
addPoly :: (Num a)=>[[a]]->[a]
addPoly x = map sum $ transpose x
运行良好
但是当我最后删除 x 时,它会出错
addPoly :: (Num a)=>[[a]]->[a]
addPoly = map sum $ transpose
错误说:
Couldn't match expected type `[[Integer]] -> [Integer]'
with actual type `[Integer]'
In the expression: map sum $ transpose
In an equation for `addPoly': addPoly = map sum $ transpose
Couldn't match expected type `[[Integer]]'
with actual type `[[a0]] -> [[a0]]'
In the second argument of `($)', namely `transpose'
In the expression: map sum $ transpose
In an equation for `addPoly': addPoly = map sum $ transpose
无法弄清楚我在这里缺少什么。
免责声明:这不是作业问题