[Haskell-cafe] What's the best way to give up?
Christopher Lane Hinson
lane at downstairspeople.org
Sat Sep 6 10:16:43 EDT 2008
>> a -> IO (Either a a ) and use getCPUTime.
>> Is there a standard way to do this? Can you think of another way to do it?
> I don't know, but this seems relevant:
> I'd make a generic (i.e. higher-order) function that handles the
> timeout for any computation. i.e.
> timeout :: (a -> b) -> Int -> a -> IO (Maybe b)
Perhaps this is for not so much for pure computations as hanging when
connecting to nonresponsive servers, although I also use it in a case
where buggy long-running code could frustrate the responsiveness of
More information about the Haskell-Cafe