这是我的代码:
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.
有人喜欢告诉我我的代码有什么问题吗?
感谢任何能给我一些建议的人。