Missing EOL in Haskell stderr output

For some unfathomable reason, stderr output for Haskell program does not take into account EOL properly. The problem only occurs with “infinite loop” games (e.g. Mars Lander as opposed to ASCII Art) and with Haskell (Java and C++ are OK at least). As far as I know, stdout is working fine too as it would be redhibitory for some games. Since it works flawlessly at home, I guess it is somewhat related to the way stderr output is handled by the game engine. Do you have any idea about what can cause this strange behavior?

As a workaround, doubling the ‘\n’ when writing to stderr solves the problem (using “\n\r” - and not “\r\n” - also do the job but for other weird reasons). In the example below:

hPutStrLn stderr "Alpha\nBeta\n\nGamma\n\rDelta\r\nEpsilon"
hPutStrLn stderr "Zeta"
hPutStrLn stderr "\nEta\n"
hPutStrLn stderr "Theta"

Only Beta/Gamma, Gamma/Delta, Zeta/Eta, and Eta/Theta get properly separated from each other.