1
我在想,爲什麼不這項工作(2個誤差修改):與故障,其中如果表達式
removeCard cardList card e =
if length $ (filter` cardList) == (length cardList)
-- the same error
-- if length $ filter` cardList == length cardList
-- if (length $ filter` cardList) == (length cardList)
then error "The error occured"
else filter` cardList
where
filter` [] = []
filter` (x:xs) = if x == card then xs else x : filter` xs
如果我只是一個簡單的表達像if 1 == 2 ...
替換如果,我會得到另一個錯誤:
parse error on input `where'