summaryrefslogtreecommitdiff
path: root/testsuite/tests/concurrent/should_run/conc002.hs
blob: ab2ed50b85fb1d6ed009c04b8c97fd99a0be3723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Main where

import Control.Concurrent

main = do
  c <- newChan
  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