Commits

badi committed a9b1d04

inline task creation and submission

Comments (0)

Files changed (1)

                                    }
 
   
-  -- create 10 tasks
-  ts <- mapM mktask [1..10]
-
-  -- submit the tasks to the queue
-  -- (equivalent to mapM_ (submit q) ts)
-  forM_ ts (submit q)
+  -- create and submit 10 tasks
+  forM_ [1..10] $ \i -> do
+         t <- mktask i
+         submit q t
 
   -- The eventLoop provides a while loop that waits until all tasks in the queue are complete.
   -- Two callbacks can be provided: