I'm try to return True or False in this expression, but i'm getting this error, can someone tell me what i'm doing wrong? Thanks.
module Main (main) where
import System.IO (stdout, hSetBuffering, BufferMode(NoBuffering))
main::IO()
simOuNao::String -> Bool
main = do hSetBuffering stdout NoBuffering
putStrLn "Guess Number v1.0"
putStrLn "======================"
simOuNao frase = do putStrLn frase
ans <- readLn
if ans == 'y' || ans =='Y'
then return True
else return False
Error message:
• Couldn't match expected type ‘Bool’ with actual type ‘IO Bool’
• In a stmt of a 'do' block: putStrLn frase
In the expression:
do { putStrLn frase;
ans <- readLn;
if ans == 'y' || ans == 'Y' then return True else return False }
In an equation for ‘simOuNao’:
simOuNao frase
= do { putStrLn frase;
ans <- readLn;
if ans == 'y' || ans == 'Y' then return True else return False }
Failed, modules loaded: none.