title: Problem with "Looping" IO in Haskell
body: <p>I'm new to Haskell, so I'm trying to make a simple two player text based game in order to help me learn it.</p>
  
  <p>However, I've come across the problem of performing IO in a "loop". As far as I am aware, variables that are set from user input cannot be used unless they are set inside main. This is a problem because a recursive call to main is useless to me since main does not take any arguments. Ideally, I would have a function called from main that calls itself until one player loses. But, this does not seem to work, since using any variables set in that function by user input results in type errors.</p>
  
  <p>The structure of the program is as follows:</p>
  
  <p>*Prompt player 1 for name and set player1 variable.</p>
  
  <p>*Prompt player 2 for name and set player2 variable.</p>
  
  <p>*The "loop": Alternate between each player, prompting for commands until one player loses.</p>
  
  <p>What would be the best way to go about tackling this problem?</p>