thorpedosg

98xDytHK

Aug 7th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. How do I create a thread pool?
  2. runPool :: Int -> [IO a] -> IO [a]
  3.  
  4. threadPoolIO :: Int -> (a -> IO b) -> IO (Chan a, Chan b)
  5. threadPoolIO nr mutator = do
  6. input forkIO (forever $ do
  7. i [IO a] -> IO [a]
  8. runPool n as = do
  9. (input, output)
Add Comment
Please, Sign In to add comment