10 Sep
2002
10 Sep
'02
3:33 p.m.
Hi all, What is the recommended way of implementing the function: timeOut :: Int -> IO a -> IO (Maybe a) which takes a maximum number of seconds (say), an IO action, and tries to run the IO action in the specified time. If it succeeds, it returns just the answer, otherwise it returns Nothing. Do I have to start two threads, one that waits and then throws an exception, the other that evaluates the IO action? Or is there a better way? (I thought of asynchronous exceptions...) /Koen. -- Koen Claessen http://www.cs.chalmers.se/~koen Chalmers University, Gothenburg, Sweden.
8527
Age (days ago)
8527
Last active (days ago)
0 comments
1 participants
participants (1)
-
Koen Claessen