Update tests now that the death of the main thread ends the program.
main = do
s <- newEmptyMVar
let
- reader = do
- str <- takeMVar s
- putStr str
+ write = do
+ putMVar s "hello world\n"
- forkIO reader
- putMVar s "hello world\n"
+ forkIO write
+ str <- takeMVar s
+ putStr str
main = do
c <- newChan
- let
- reader = do
- char <- readChan c
- if (char == '\n')
- then return ()
- else do putChar char; reader
- forkIO reader
- writeList2Chan c "Hello World\n"
+ let writer = writeList2Chan c "Hello World\n"
+ forkIO writer
+ let reader = do char <- readChan c
+ if (char == '\n')
+ then return ()
+ else do putChar char; reader
+ reader