I have a function:
isSimpleNumber :: Int -> Bool
isSimpleNumber x = let deriveList = map (\y -> (x `mod` y)) [1 .. x]
filterLength = length ( filter (\z -> z == 0) deriveList
....
After filterLength i want to check how much filterLength, i try:
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
I get error:
parse error (possibly incorrect indentation)
Failed, modules loaded: none.
How can i put indentation correctly with if and in?
Thank you.
This will compile:
There was a missing closing “)” after “deriveList”. You don’t need an if-then-true expression, also.