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:
withEcho can be written with a little less noise:
withEcho :: Bool -> IO a -> IO a withEcho echo action = bracket (hGetEcho stdin) (hSetEcho stdin) (const $ hSetEcho stdin echo >> action)