I am new to haskell and stuck with the input parse error on '=' I was trying a function to check if a number is prime Here is the function -
isprime x
| x<=1 = "not prime"
| x == 2 = "yes"
| a = floor (sqrt x)
lis = [2..a]
divbylis (headlis:taillis)
| length taillis <=0 = "yes it is prime"
| x 'mod' headlis == 0 = "No not prime"
| otherwise = divbylis taillis**
and it shows the error -
first.hs:58:15: error:
parse error on input ‘=’
Perhaps you need a 'let' in a 'do' block?
e.g. 'let x = 5' instead of 'x = 5'
line 58 is the line with declaration of lis = [2..a]**