Skip to content

Instantly share code, notes, and snippets.

@tanakh
Created March 9, 2012 12:06
Show Gist options
  • Select an option

  • Save tanakh/2006253 to your computer and use it in GitHub Desktop.

Select an option

Save tanakh/2006253 to your computer and use it in GitHub Desktop.
mayhem :: [(IO (), IO ())] -> IO ()
mayhem xs = do
forM_ xs $ \(event, reaction) -> fork $ forever $ do
event >> reaction
forever $ threadDelay $ 10 ^ 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment