The following Haskell program prompts the user for a password in the terminal and continues if he has entered the correct one:
main = do putStrLn \"Password:
I have found this useful when reading passwords:
import Control.Exception import System.IO withoutEcho :: IO a -> IO a withoutEcho action = finally (hSetEcho stdin False >> action) (hSetEcho stdin True)