module Main where import Control.Concurrent (threadDelay) import Control.Concurrent.Async (race_) main :: IO () main = do -- create an STM variable holding the list of incoming messages. -- tIncoming <- (STM.newTVarIO []) :: IO (STM.TVar [Message]) putStrLn "Hello, Haskell!" runServer `race_` do putStrLn "1" threadDelay 1000 runClients putStrLn "2" threadDelay 2000 putStrLn "3" runServer = do putStrLn "running server" runClients = do putStrLn "running clients"