这里是我的代码:高阶函数,输入`|'解析错误
select_where_true :: (Double -> Bool) -> [Double] -> [Double]
select_where_true is_neg [a] = case [a] of
[] -> []
x:xs -> is_neg x
|(is_neg x) == False = []
|(is_neg x) == True = x ++ (select_where_true is_neg xs)
is_neg :: Double -> Bool
is_neg x = x < 0
这里是错误消息:
[1 of 1] Compiling Main (test.hs, interpreted)
test.hs:5:18: parse error on input `|'
Failed, modules loaded: none.
任何人都喜欢告诉我什么是错我的代码?
感谢任何能够帮助我的人一些建议。
THXü这么多,我都遵循什么ü说和固定它。 – libra 2013-05-14 01:44:42