diff options
Diffstat (limited to 'common.sml')
-rw-r--r-- | common.sml | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -6,32 +6,6 @@ fun id x = x fun assert truth = if not truth then raise Unreachable else () -(* All global values which computations may raise an exception must be - * wrapped in lazy, so that no exception is thrown before custom - * top-level handler is set. - *) -fun lazy thunk = -let - datatype 'a value = - Unevaluated of unit -> 'a | - Evaluated of 'a | - Exn of exn - - val value = ref $ Unevaluated thunk -in - fn () => - case !value of - Unevaluated th => - let - val x = th () handle e => (value := Exn e; raise e) - in - value := Evaluated x; - x - end - | Evaluated v => v - | Exn e => raise e -end - structure Fold = struct fun fold (a, f) g = g (a, f) fun step0 h (a, f) = fold (h a, f) |