Proposal: System.Timeout module for base
Peter Simons
simons at cryp.to
Mon Jan 29 13:30:51 EST 2007
Hi David,
let's agree to disagree. Apparently our personal preferences
differ when it comes to error handling.
Regarding the submission of 'timeout', I feel that those two
lines say it all:
timeout n f >>= maybe (fail "timeout") return
(Just `fmap` timeout n t) `catch` (\_ -> return Nothing)
An exception-throwing timeout combinator is obviously equivalent
to one that returns "Maybe a" because both versions can be
trivially wrapped to behave like the other one.
I am in favor of using the version we have.
Best regards,
Peter
More information about the Libraries
mailing list