I have two threads in haskell that perform IO. (They print only). Something like the following:
thread1 :: IO ()
thread1 = putStrLn "One"
thread2 :: IO ()
thread2 = putStrLn "Two"
I am currently getting results like the following:
OnTwoe
OTnweo
How can I ensure that each thread completes its IO atomically?