while :: Int -> Bool -> (Int,Int) -> (Int,Int) ->[Int] -> String
while arguments validity premRange atomRange operators =
return(if validity then "Hello" else "NO")
main :: IO()
main =
do
putStrLn "Welcome to Random Argument Generator"
arguments <- getArguments
validity <- getValidity
putStrLn "Enter the range of the number of premises to each argument"
premRange <- getRange
putStrLn "Enter the range of the number of atomic statments per premises"
atomRange <- getRange
operators <- getOperators
putStrLn "Thank You!\nExecuting..."
test <- while arguments validity premRange atomRange operators
putStrLn "Good Bye"
Its complaining about my return in while and my call to it. i made this function as a test and im really confused as to what its complaining about exactly.
returnin Haskell does not mean what it means in other languages. For normal functions, you will never need to usereturn.returnin Haskell is specifically aboutIO(and other monads); namely it makes anIOcomputation out of a pure value.return :: a -> IO areturn IO("xxx"). In Haskell, the return statement is implicit, the monad constructor is calledreturnand the"xxx"stays the same.