title: Concurrent Haskell Actions with Timeout
body: <p><p>how could one implement a function in concurrent haskell that either returns 'a' successfully or due to timeout 'b'?</p>
  
  <pre><code>timed :: Int → IO a → b → IO (Either a b)
  timed max act def = do
  </code></pre>
  
  <p></p><p>Best Regards,<br/>
  Cetin Sert<p>Note: the signature of timed can be completely or slightly different.</p></p>