# HG changeset patch # User wenzelm # Date 1419800591 -3600 # Node ID b51489b75bb95615f98c0745baaffac06e942680 # Parent 59f1591a11cb82accf585f8685430167bc5cd805 proper sequential version; diff -r 59f1591a11cb -r b51489b75bb9 src/Pure/Concurrent/lazy_sequential.ML --- a/src/Pure/Concurrent/lazy_sequential.ML Sun Dec 28 21:34:45 2014 +0100 +++ b/src/Pure/Concurrent/lazy_sequential.ML Sun Dec 28 22:03:11 2014 +0100 @@ -17,15 +17,17 @@ abstype 'a lazy = Lazy of 'a expr Unsynchronized.ref with +fun lazy e = Lazy (Unsynchronized.ref (Expr e)); +fun value a = Lazy (Unsynchronized.ref (Result (Exn.Res a))); + fun peek (Lazy r) = (case ! r of Expr _ => NONE | Result res => SOME res); -fun lazy e = Lazy (Unsynchronized.ref (Expr e)); -fun value a = Lazy (Unsynchronized.ref (Result (Exn.Res a))); - +fun is_running _ = false; fun is_finished x = is_some (peek x); +val finished_result = peek; (* force result *)