Chaitin's (try)

Tom Pledger Tom.Pledger@peace.com
Fri, 31 Aug 2001 11:47:35 +1200


Carl McTague writes:
 | Does anybody have an interest in something like Gregory Chaitin's
 | function (try) from his custom lisp in Haskell?
 :

Have a look at the timeout function in Tackling The Awkward Squad, in
the section on asynchronous exceptions (6.5.1 in the version I'm
looking at).

    http://research.microsoft.com/Users/simonpj/papers/marktoberdorf.htm

The impurity is captured by function's result being an IO action.

    timeout :: Int -> IO a -> IO (Maybe a)