Created
November 19, 2014 07:19
-
-
Save mwotton/988b83339a3f2c4ab481 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