IO reordering
I have a simple test program:
main = do putStr "> "
line <- getLine
putStrLn line
In ghci, it writes "> " before receiving input:
Prelude Main> main
> WHAT
WHAT
But being compiled by ghc it writes "> " just after receiving input.
maelstrom@ubuntu:~/vault$ ./test
WHAT
> WHAT
That is not the behavior I expect.
Trac metadata
Trac field | Value |
---|---|
Version | 7.4.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |