h. wrote:
module Main where
main :: IO ()
main = f
  where
  f = do
    a <- getLine
    if a == "quit" then return () else putStrLn a >> f

This one also needs to switch to line buffering. Add/Change:

import System.IO(stdout, hSetBuffering, BufferMode(LineBuffering))
main = hSetBuffering stdout LineBuffering >> f


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to