<div dir="ltr">Please, I&#39;m trying to do some user user input validation, but it looks like my  approach is not correct. Here is my code:<div><br></div><div><div>textInput :: IO ()</div><div>textInput</div><div><span class="" style="white-space:pre">        </span>| dataIn == &quot;bye&quot; = return () </div>
<div><span class="" style="white-space:pre">        </span>| otherwise          = textInput</div><div><span class="" style="white-space:pre">        </span>where dataIn &lt;- getLine</div></div><div><br></div><div style>the idea is that when user inputs &quot;bye&quot; the program should end/return. Problem is that I&#39;m getting &#39;parse error on input `&lt;-&#39;&#39; error. How can I achieve it?</div>
<div style><br></div><div style>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 == &quot;bye):</div><div style><br></div><div style>
<div><div>textInput :: IO ()</div><div>textInput</div><div><span class="" style="white-space:pre">        </span><b>| dataIn == &quot;bye&quot; = (puStrLn &quot;quitting&quot;, return () ) -- </b></div><div><span class="" style="white-space:pre">        </span>| otherwise          = textInput</div>
<div><span class="" style="white-space:pre">        </span>where dataIn &lt;- getLine</div></div><div><br></div><div style>Millions of thanks for any kind of input..</div><div style><br></div><div style>Cheers,</div><div style>Miro</div>
</div></div>