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