blob: 99488fb07b1318dec39f9292139aab3cf01b6f06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
module Main where
import Control.Concurrent
-- two processes, one MVar communication.
main = do
s <- newEmptyMVar
let
write = do
putMVar s "hello world\n"
forkIO write
str <- takeMVar s
putStr str
|