我有一个功能:
isSimpleNumber :: Int -> Bool
isSimpleNumber x = let deriveList = map (\y -> (x `mod` y)) [1 .. x]
filterLength = length ( filter (\z -> z == 0) deriveList
....
在 filterLength 我想检查多少 filterLength 之后,我尝试:
isSimpleNumber :: Int -> Bool
isSimpleNumber x = let deriveList = map (\y -> (x `mod` y)) [1 .. x]
filterLength = length ( filter (\z -> z == 0) deriveList
in if filterLength == 2
then true
我得到错误:
parse error (possibly incorrect indentation)
Failed, modules loaded: none.
如何使用 if 和 in 正确放置缩进?
谢谢你。