proper sequential version;
authorwenzelm
Sun, 28 Dec 2014 22:03:11 +0100
changeset 59194 b51489b75bb9
parent 59193 59f1591a11cb
child 59195 f8588372d70e
proper sequential version;
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 *)