diff -r 30cbd2685e73 -r f3b1ca16cebd src/Pure/General/susp.ML --- a/src/Pure/General/susp.ML Sat Oct 08 22:39:39 2005 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -(* Title: Pure/General/susp.ML - ID: $Id$ - Author: Sebastian Skalberg, TU Muenchen - -Delayed evaluation. -*) - -signature SUSP = -sig - -type 'a susp - -val force : 'a susp -> 'a -val delay : (unit -> 'a) -> 'a susp -val value : 'a -> 'a susp - -end - -structure Susp :> SUSP = -struct - -datatype 'a suspVal - = Value of 'a - | Delay of unit -> 'a - -type 'a susp = 'a suspVal ref - -fun force (ref (Value v)) = v - | force (r as ref (Delay f)) = - let - val v = f () - in - r := Value v; - v - end - -fun delay f = ref (Delay f) - -fun value v = ref (Value v) - -end