Re: [Haskell-cafe] unexpected compiler behavior

2006-12-05 Thread Donald Bruce Stewart
jepalomar23: > Hi, > I am newbie in Haskell and do not understand why the interpreted mode > differs from the compiled program. > I run this code > main = do > putStr "line1" > x<-getLine > putStr "line2" > y<-getLine > return (x++y) > > either un

Re: [Haskell-cafe] unexpected compiler behavior

2006-12-05 Thread Cale Gibbard
The problem is most likely that line-buffered (or possibly block-buffered) IO is turned on, which means that buffers will only automatically be flushed to the display at the ends of lines. You can fix it by importing System.IO, and either calling (hFlush stdout) explicitly, or by calling (hSetBuff

[Haskell-cafe] unexpected compiler behavior

2006-12-05 Thread jepalomar23
Hi, I am newbie in Haskell and do not understand why the interpreted mode differs from the compiled program. I run this code main = do putStr "line1" x<-getLine putStr "line2" y<-getLine return (x++y) either under runhugs or runghc or in a console