Does anybody have an interest in something like Gregory Chaitin's function (try) from his custom lisp in Haskell? (Please see http://www.umcs.maine.edu/~chaitin/rov.html for more information.) It would be a function that attempts to evaluate its argument within a specified amount of cpu time, returning something like Maybe's Nothing (but perhaps more informative) in the case that time runs out, and something like Just, otherwise. Would that toy with referential transparency? Carl
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)
participants (2)
-
Carl McTague -
Tom Pledger