小编use*_*988的帖子

Haskell在最后调整以删除参数变量

我是一个尝试学习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)

haskell pointfree function-composition

3
推荐指数
1
解决办法
502
查看次数

标签 统计

function-composition ×1

haskell ×1

pointfree ×1