diff options
author | Vladimir Azarov <avm@intermediate-node.net> | 2025-04-11 21:54:16 +0200 |
---|---|---|
committer | Vladimir Azarov <avm@intermediate-node.net> | 2025-04-11 21:54:16 +0200 |
commit | e99a8dc48ede26696be2ba75a8cb0d5122d94598 (patch) | |
tree | c3dcd1d6a9b96aaedd081f13b9dc7e7d6c07e2bd /general.sml | |
parent | 8e2dc7712de206b87e1c46df9383c3fa1e18a43a (diff) |
#include directive
Diffstat (limited to 'general.sml')
-rw-r--r-- | general.sml | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/general.sml b/general.sml deleted file mode 100644 index cb4652a..0000000 --- a/general.sml +++ /dev/null @@ -1,32 +0,0 @@ -exception Unreachable - -fun $ (x, y) = x y -infixr 0 $ - -fun printLn s = (print s; print "\n") - -(* 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 |