小编kai*_*ker的帖子

从带有ruby on rails的网站获取html

如何使用ruby on rails获取网站上其他网站的页面数据?

ruby ruby-on-rails

5
推荐指数
2
解决办法
5284
查看次数

无法获得在Haskell中编译的无点表示法

这很有效

unique :: (a -> Bool) -> [a] -> Bool
unique p xs = 1 == length (filter p xs)
Run Code Online (Sandbox Code Playgroud)

但现在我想要它的形式:

unique = (== 1) . length . filter
Run Code Online (Sandbox Code Playgroud)

错误信息:

Couldn't match expected type `[a] -> Bool' with actual type `Bool'
Expected type: b0 -> [a] -> Bool
  Actual type: b0 -> Bool
In the first argument of `(.)', namely `(== 1)'
In the expression: (== 1) . length . filter
Run Code Online (Sandbox Code Playgroud)

为什么这不起作用?

haskell pointfree function-composition

2
推荐指数
1
解决办法
150
查看次数