Created
April 27, 2014 03:16
-
-
Save mwotton/11336830 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad | |
import System.IO | |
main :: IO () | |
main = do | |
hSetBuffering stdout LineBuffering | |
forever $ do | |
getLine >> emptyStdin | |
putStrLn "x" | |
emptyStdin :: IO () | |
emptyStdin = do | |
res <- hReady stdin | |
when res $ getLine >> void emptyStdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment