我的代码:哈斯克尔初学者顺序功能
isOrdered :: (a -> a -> Bool) -> [a] -> Bool
isOrdered mark xs =(head xs) `mark`(head(tail xs))
编译完美,但是当我尝试
isOrdered < [1,2,3]
调用它,我得到一个错误:
Couldn't match expected type `(a0 -> a0 -> Bool) -> [a0] -> Bool'
with actual type `[t0]'
In the second argument of `(<)', namely `[1, 2, 3]'
In the expression: isOrdered < [1, 2, 3]
In an equation for `it': it = isOrdered < [1, 2, 3]
我在想什么这里?
谢谢!我不知道我是怎么忘了那个...... –