title: Prompting for a password in Haskell command line application
body: <p>The following Haskell program prompts the user for a password in the terminal and continues if he has entered the correct one:</p>
  
  <pre><code>main = do
      putStrLn "Password:"
      password &lt;- getLine
  
      case hash password `member` database of
          False -&gt; putStrLn "Unauthorized use!"
          True  -&gt; do
                   ...
  </code></pre>
  
  <p>Unfortunately, the password will appear on the screen as the user types it, which I want to avoid.</p>
  
  <blockquote>
    <p>How can I read a sequence of characters that the users types without having the show up on the screen? What is the equivalent of <code>getLine</code> for this purpose?</p>
  </blockquote>
  
  <p>I'm on MacOS X, but I would like this to work on Windows and Linux, too.</p>