壓痕哈斯克爾奇怪的錯誤,我有以下代碼:約的IF-THEN-ELSE
foo :: Int -> [String] -> [(FilePath, Integer)] -> IO Int
foo _ [] _ = return 4
foo _ _ [] = return 5
foo n nameREs pretendentFilesWithSizes = do
result <- (bar n (head nameREs) pretendentFilesWithSizes)
if result == 0
then return 0 -- <========================================== here is the error
else foo n (tail nameREs) pretendentFilesWithSizes
我得到上面的註釋的行的錯誤,錯誤的是:
aaa.hs:56:2:
parse error (possibly incorrect indentation)
我正在使用emacs,沒有空格,我不明白我做錯了什麼。
它解決了這個問題,10倍! – Drakosha 2010-05-31 19:37:01