File: race.hs

package info (click to toggle)
haskell-async 2.0.1.3-1~bpo70%2B1
  • links: PTS
  • area: main
  • in suites: wheezy-backports
  • size: 84 kB
  • sloc: haskell: 350; makefile: 3
file content (8 lines) | stat: -rw-r--r-- 216 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
import Control.Concurrent.Async
import System.Environment
import Control.Monad
import Control.Concurrent

main = runInUnboundThread $ do
  [n] <- fmap (fmap read) getArgs
  replicateM_ n $ race (return 1) (return 2)