This looks more like a buffering than a sequencing problem. What platform are you on? Have you tried forcing unbuffered output?
hSetBuffering stdout NoBuffering -- from System.IO
This looks more like a buffering than a sequencing problem. What platform are you on? Have you tried forcing unbuffered output?
hSetBuffering stdout NoBuffering -- from System.IO