[Haskell] line-based interactive program

Bulat Ziganshin bulatz at HotPOP.com
Thu Jul 7 11:57:34 EDT 2005

Hello Christian,

Thursday, July 07, 2005, 6:55:13 PM, you wrote:

CM> Could you also insert a prompt that is shown before the lines are read?
CM> (The first prompt seems to be tricky assuming line buffering )

import System.IO

main = do
  hSetBuffering stdin  LineBuffering
  hSetBuffering stdout LineBuffering
  interact (unlines.filter(not.null).lines.('>':))

Best regards,
 Bulat                            mailto:bulatz at HotPOP.com

More information about the Haskell mailing list