I currently am creating a program that takes a number from a user and then decides what happens based off the input:
function :: Int -> IO ()
function n = do
putStr "Input: "
x <- getLine
let y = (read x :: Int)
if y == n
then
print "Something"
else if y < n
then
print "Something"
function n
else if y > n
then
print "Something"
function n
However, the code above returns a 'parse error (possibly incorrect indentation or mismatched brackets)' error. This error seems to occur when I put any sort of conditional statement (if/guard/case) after the let guess = (read x :: Int) line and I cannot figure out why. Any suggestions would be much appreciated, thanks in advance.