Please, I'm trying to do some user user input validation, but it looks like my  approach is not correct. Here is my code:

textInput :: IO ()
textInput
| dataIn == "bye" = return () 
| otherwise          = textInput
where dataIn <- getLine

the idea is that when user inputs "bye" the program should end/return. Problem is that I'm getting 'parse error on input `<-'' error. How can I achieve it?

Another question I have is: how can I have more actions in guard, when the condition is valid. Something like (write on IO + return if dataIn == "bye):

textInput :: IO ()
textInput
| dataIn == "bye" = (puStrLn "quitting", return () ) -- 
| otherwise          = textInput
where dataIn <- getLine

Millions of thanks for any kind of input..

Cheers,
Miro