我是一个尝试学习haskell的新手,我试图在其他论坛中寻找类似的东西但是找不到类似的问题.
addPoly :: (Num a)=>[[a]]->[a]
addPoly x = map sum $ transpose x
Run Code Online (Sandbox Code Playgroud)
运行正常
但是当我最后删除x时,它会出错
addPoly :: (Num a)=>[[a]]->[a]
addPoly = map sum $ transpose
Run Code Online (Sandbox Code Playgroud)
错误说:
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 $ …Run Code Online (Sandbox Code Playgroud)