How to force main thread to wait for all its child threads finish in Haskell
问题 In the following Haskell code, how to force main thread to wait till all its child threads finish. I could not able to use forkFinally as given in the section "Terminating the Program" here in this link: (http://hackage.haskell.org/package/base-4.7.0.2/docs/Control-Concurrent.html). I get desired result when using TMVar. But I want to do this with TVar. Please help. module Main where import Control.Monad import Control.Concurrent import Control.Concurrent.STM type TInt = TVar Int transTest ::