
30 Jun
2012
30 Jun
'12
11:03 a.m.
Hello, I'm having a problem with GHC. When I compile the code bellow it does nothing, but If I try to use ghci it works normally. it seems a simple problem, but I can't understand. Thanks for the help Mauricio import System.IO import Control.Concurrent import Data.List main = do input <- newMVar [1..30000] ia <- newEmptyMVar ib <- newEmptyMVar ic <- newEmptyMVar forkIO $ do x <- readMVar input putMVar ia x forkIO $ do a <- readMVar ia putMVar ib ( sum a ) forkIO $ do a <- readMVar ia putMVar ic ( reverse a ) forkIO $ do b <- readMVar ib c <- readMVar ic print b print c